I need MP3 file consiting of literally 2 (two) complete frames @ 44100/16 bit/stereo, without any metadata. The issue here is that I need to be able to create it myself as cutting 2 frames from larger file will cause artifacts in my decoder processing.

I tried the following

  • windows sound recorder - can record only up to 24 kHz, I need 44100, my decoder can not handle it;
  • VLC seems not understanding such small files - I tried to feed 0.02 second WAV file to it, and it refuses to convert (generates output file of size of 0);
  • there's an application called FFMPEG, I have it on PC, but can not make it working, too complicated for me. Not sure if it can take fractional input for -t key though.

I am sure those who deal with electronic music can help me. Thank you in advance.

Update: my question really seems to be offtopic here, and DSP (digital signal processing) is not about music, but about technology, however I was hoping that musicians use technology and must know how analog and digital works relating to making a sound.

I found out that I, most probably, need more than 2 frames to fill 2048 bytes of decoder's buffer for decoder to start processing. The main issue I am solving that decoder does not have option to reset (zero) its intermediate buffers, and the only way to reset them is to push several frames of silence through them.

Thus it is just down to the understanding MP3 format, and I even will not need frames, I will need algorithm how to construct data within the frame so that they would decode to all zeros (silence).

  • 1
    maybe a different stack for what you are looking for? stackoverflow.com/questions/39734057/… – Alphonso Balvenie Oct 15 '17 at 20:21
  • @AlphonsoBalvenie thank you, I saw this question, but for specific reason decided to post question here to get more options from music technologists. I not only needed to insert silence, I must have understood how to create it myself. I know how to do it now without any utility. – Anonymous Oct 16 '17 at 21:53

This question may not be on topic here, but in Audacity if you create a new (empty) project and then go to Generate > Silence... you can generate whatever length of silence you want in units of seconds, samples, frames and more.

Then go to File > Export audio, and choose MP3.


Just to be sure others will be able to find solution to this question. Silent MP3 frame consists of the header, side info and data comprised of just one type of byte. Here're two headers - first to be used for the first frame, and second for all subsequent frames:

Header (including side info) of the first frame

FF FB 90 64-00 0F F0 00-00 69 00 00-00 08 00 00
0D 20 00 00-01 00 00 01-A4 00 00 00-20 00 00 34
80 00 00 04

Header (including side info) of following frames

FF FB 90 64-40 8F F0 00-00 69 00 00-00 08 00 00
0D 20 00 00-01 00 00 01-A4 00 00 00-20 00 00 34
80 00 00 04

Size of data following the header and side info is 381 bytes, and consists of 381 copies of byte 'U' (0x55). It decodes to all zeros using respective Huffman table. Thus in total frame size is 417 bytes. Each frame (to my understanding) will decode into 1152 16-bit stereo samples, performing at 44100 Hz (thus lasts for ~26.122 ms).

  • For some reason audacity does not show second frame: If only the first frame is used, it is shown with correct duration. If two frames are used, the same duration (~26.122 ms) is used, and if N frames are used (N>2), total duration is 26.122*(N-1). What may be the cause of this? Where can one find the description of this headers byte-by-byte? – Igor Liferenko Jan 17 '18 at 6:52
  • There're a number of websites showing this information, but the best explanation I found is this one mp3-tech.org/programmer/docs/mp3_theory.pdf. I suspect it uses N-1 frames dropping last frame, thinking that 26 ms is not actually much audible and does not affect quality of listening. Why? this is good question to the developers of the Audacity. Could be feature or bug :) – Anonymous Jan 17 '18 at 7:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.