We've been building our game prototype pretty nicely using Edge so far.
Now we're going into sound. Hekkus library supports ogg format, but it looks like (from what I read and tried) there are some issues with EdgeLib.
Here's the code I tried (modified from hekkus example) :
- Code: Select all
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17if (ecd.snd->LoadMusic(0, "1.ogg") == E_OK)
ecd.snd->PlayMusic(0, true);
else
{
FILE * lfile_dumb = fopen("1.ogg","rb");
if ( lfile_dumb != NULL )
{
char data[1000000];
char * buff;
long sizeRead = fread(data, 1, 1000000, lfile_dumb);
fclose( lfile_dumb );
buff = (char*) malloc( sizeof(char) * sizeRead);
memcpy(buff,data, sizeof(char) * sizeRead);
if (ecd.snd->LoadMusic(2, buff, sizeRead) == E_OK)
ecd.snd->PlayMusic(0, true);
}
}17 lines; 14 keywds; 7 nums; 82 ops; 3 strs; 0 coms Syntactic Coloring v0.4 - Dan East
Neither the file or buffer method succeed.
The ogg file has the following data :
Processing file "1.ogg"...
New logical stream (#1, serial: 000037ae): type vorbis
Vorbis headers parsed for stream 1, information follows...
Version: 0
Vendor: BS; Lancer(SSE) [20061110] (based on aoTuV b5 [20061024])
Channels: 1
Rate: 44100
Nominal bitrate: 48,000000 kb/s
Upper bitrate not set
Lower bitrate not set
Vorbis stream 1:
Total data length: 739063 bytes
Playback length: 2m:12.145s
Average bitrate: 44,742475 kb/s
Logical stream 1 ended
But others would not play either.
Is there any chance to play those files with the current version ? If so any hint ?
Thanks,
Philippe
