LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   MP3-files frame sizes (https://www.linuxquestions.org/questions/programming-9/mp3-files-frame-sizes-147498/)

Berng 02-18-2004 02:56 AM

MP3-files frame sizes
 
Could anybody help to understand, how mp3-encoder determine frame sizes (when packing music files), do their have some standart sizes and how i could determine this size?
Thanks a lot,
Oleg.

PSIplus 02-18-2004 06:42 AM

Most mp3 de- and encoding libraries have functions for it. You don't have to do the low-level work then (otherwise you wouldn't require the lib ;-) )

If you want to encode, liblame is a good choice.
For decoding I use mpeglib...

If you just want to play audio-data, you can use the SDL or something like this:

Code:

pid_x=fork();
if(!pid_x)
{
        stdin=freopen("/dev/null","r+",stdin);
        stdout=freopen("/dev/null","w+",stdout);
        stderr=freopen("/dev/null","w+",stderr);
        execlp("/usr/bin/mpg123","/usr/bin/mpg123","/path/to/your/mp3/file.mp3",NULL);
        printf("Error: Unable to execute the player!\n");
        exit(1);
}

Easy but nice solution used in many apps :-)


All times are GMT -5. The time now is 04:38 AM.