NitinG
NitinG

Reputation: 923

FFMPEG audio decoding

I have used the avcodec_decode_audio3 function to decode the AMR content in the frame order.

I get 640 bytes output for each frame, with sample format being float and I have saved the output as a raw output file.

Now, I want to validate this output content. But I can't play it in any player as it does not have any header or media info. And I am not able to find any command in ffmpeg which gives me raw audio output.

Now, if want to re-encode that raw output content in FFMPEG, what would be the input format I need to give.

Can anybody give some suggestion on this?

Upvotes: 1

Views: 2904

Answers (1)

Dmitry Shkuropatsky
Dmitry Shkuropatsky

Reputation: 3965

If the audio data is saved in a binary file as raw (headerless), you can use Audacity to import is as raw data and play it back. You would need to provide sample encoding, sample rate and number of channels.

If there are any problems you can perform conversion to a raw file using ffmpeg, and use the result for comparison. For example:

ffmpeg -i input.wav -f f32le output.raw

produces raw audio file with 32-bit little-endian float samples, with original sample rate and number of channels. Alternatively, result sample rate and number of channels can be specified, for example, -ar 44100 and -ac 2.

Upvotes: 1

Related Questions