Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 07-04-2007, 04:16 PM   #1
Registered: Jul 2006
Location: Peabody, MA, USA
Distribution: Xubuntu, Slackware, Pop!_OS
Posts: 162
Blog Entries: 2

Rep: Reputation: 17
Playing .mp3 files with C code

Hey everyone,
As a pet project I decided I wanted to try to write a program to play sound files. At the moment it basically works like aplay (I'm using ALSA utilities), and only plays .wav files. I'd like to make it able to play mp3s, so how do I go about doing that? I suppose I need some kind of decoder, preferably one that works on-the-fly (like converting .mp3 data from a stream into .wav or something). I guess it's pretty obvious that I don't really know what I'm talking about, but if anyone has any advice that'd be great.


(PS Been reading about Ogg as well, which I would could use instead of also if anyone can suggest how to do the above in ogg format that'd be cool too :-))
Old 07-04-2007, 04:39 PM   #2
Senior Member
Registered: Aug 2003
Location: Glasgow
Distribution: Fedora / Solaris
Posts: 3,109

Rep: Reputation: 96

I'd probably start by looking at the source from, say, mpg123:



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems playing mp3 files hexadecimal0f SUSE / openSUSE 11 06-09-2006 04:38 PM
Playing MP3 files tiredoflogins Linux - Newbie 2 10-02-2004 03:12 PM
Playing Mp3 files in RH9 Adam555 Linux - Newbie 7 05-06-2004 01:23 PM
playing mp3 files in Knoppix luminiscent Linux - Newbie 3 04-22-2004 09:42 PM
Playing remote MP3 files rsanfelice Linux - Software 4 04-20-2004 11:02 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:21 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration