Skip to content

Truly independent web browser

837 B
Raw Blame
/*
 * Copyright (c) 2026, Jelle Raaijmakers <[email protected]>
 *
 * SPDX-License-Identifier: BSD-2-Clause
 */

#pragma once

#include <AK/NonnullRefPtr.h>
#include <AK/Optional.h>
#include <AK/Vector.h>
#include <LibAudio/SampleSpecification.h>
#include <LibMedia/Export.h>
#include <LibMedia/Forward.h>
#include <LibMediaCodecs/DecoderError.h>
#include <LibMediaCodecs/Limits.h>

namespace Media {

// Linear PCM audio held entirely in memory: one Vector of samples per channel, all of equal length.
struct DecodedAudioData {
    Audio::SampleSpecification sample_specification;
    Vector<Vector<float>> channels;
};

MEDIA_API DecoderErrorOr<DecodedAudioData> decode_entire_audio_stream(NonnullRefPtr<MediaStream> const&, Optional<u32> output_sample_rate = {}, size_t maximum_decoded_byte_count = MAX_DECODED_AUDIO_BYTE_COUNT);

}