Welcome! Log In Create A New Profile

Advanced

OGG, MP3 & FLAC + id3

Posted by Pajn 
OGG, MP3 & FLAC + id3
August 05, 2009 12:59PM
How should i do to play OGG, MP3 and Flac and be able to read the id3 information?
Right now i haven't started on any sound code because i don't wont to re-write it to be able to read the id3.

Sorry for my bad English.
Re: OGG, MP3 & FLAC + id3
August 05, 2009 11:28PM
Check out the source for Dragon Media Player for code to play those three formats on the Wii. Reading the metadata information for Vorbis and FLAC is fairly simple as they both use the same tag format; read the specs here. The reference decoders also contain code to read the metadata for those formats. Id3 is less trivial as there are different versions (v1, v2, v2.2, v2.3 and 2.4) and IMO each one is rather messy. If your project is using C++, you might want to port TagLib.
Re: OGG, MP3 & FLAC + id3
August 05, 2009 11:37PM
Thanks, I will look at it tomorrow. If it could made some difference I will only read artist, album, title and year from ID3. No album art or something like that.

I currently uses C.

EDIT: Now, when I have looked on the dmp source there is one thing i don't understand.
How can he/she include files that doesn't exist?
Eg.
#include "flac/stream_decoder.h"
#include "mpg123.h" 

#include "vorbis/codec.h"

#include "vorbis/vorbisfile.h"

EDIT2: I tested the oggplayer.c included in libwiigui but gets
rasmus@rasmus-desktop:~/wii/Quiizum$ make
make[1]: *** No rule to make target `test.ogg.o', needed by `/home/rasmus/wii/Quiizum/Quiizum.elf'.  Stop.
make: *** [build] Error 2

This is what i do
#include "oggplayer.h"
//Other stuff
// Initiate audio
AUDIO_Init(NULL);
ASND_Init();
ASND_Pause(0);
//other stuff
PlayOgg(mem_open((char *)test_ogg,test_ogg_size, 0, OGG_ONE_TIME);

And in my makefile

LIBS	:=	-lpng -ljpeg -lz -lfat -lwiiuse -lbte -logc -lm -lasnd
#other stuff
OGGFILES	:=	$(foreach dir,$(DATA),$(notdir $(wildcard $(dir)/*.ogg)))

#---------------------------------------------------------------------------------
# use CXX for linking C++ projects, CC for standard C
#---------------------------------------------------------------------------------
ifeq ($(strip $(CPPFILES)),)
	export LD	:=	$(CC)
else
	export LD	:=	$(CXX)
endif

export OFILES	:=	$(addsuffix .o,$(BINFILES)) \
					$(CPPFILES:.cpp=.o) $(CFILES:.c=.o) \
					$(sFILES:.s=.o) $(SFILES:.S=.o) $(OGGFILES:.ogg=.ogg.o)

EDIT3: Now I get
rasmus@rasmus-desktop:~/wii/Quiizum$ make
test.ogg
bin2s -a 32 /home/rasmus/wii/Quiizum/data/test.ogg | powerpc-gekko-as -o test.ogg.o
echo "extern const u8" `(echo test.ogg | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"_end[];" > `(echo test.ogg | tr . _)`.h
echo "extern const u8" `(echo test.ogg | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`"[];" >> `(echo test.ogg | tr . _)`.h
echo "extern const u32" `(echo test.ogg | sed -e 's/^\([0-9]\)/_\1/' | tr . _)`_size";" >> `(echo test.ogg | tr . _)`.h
make[1]: *** No rule to make target `/home/rasmus/wii/Menu-test/source/GRRLIB/GRRLIB.c', needed by `GRRLIB.o'.  Stop.
make: *** [build] Error 2
changes in makefile
added
%.ogg.o	:	%.ogg



Edited 3 time(s). Last edit at 08/06/2009 01:21PM by Pajn.
Sorry, only registered users may post in this forum.

Click here to login