134 int load_OggVorbis (const char *filename, ALenum *format, uint8_t**data, ALsizei *bitsize, ALsizei *freq) { |
134 int load_OggVorbis (const char *filename, ALenum *format, uint8_t**data, ALsizei *bitsize, ALsizei *freq) { |
135 //implementation inspired from http://www.devmaster.net/forums/showthread.php?t=1153 |
135 //implementation inspired from http://www.devmaster.net/forums/showthread.php?t=1153 |
136 FILE *oggFile; // ogg handle |
136 FILE *oggFile; // ogg handle |
137 OggVorbis_File oggStream; // stream handle |
137 OggVorbis_File oggStream; // stream handle |
138 vorbis_info *vorbisInfo; // some formatting data |
138 vorbis_info *vorbisInfo; // some formatting data |
139 vorbis_comment *vorbisComment; // other less useful data |
|
140 int64_t pcm_length; // length of the decoded data |
139 int64_t pcm_length; // length of the decoded data |
141 int size = 0; |
140 int size = 0; |
142 int section, result, i; |
141 int section, result; |
|
142 #ifdef DEBUG |
|
143 int i; |
|
144 vorbis_comment *vorbisComment; // other less useful data |
|
145 #endif |
143 |
146 |
144 oggFile = Fopen(filename, "rb"); |
147 oggFile = Fopen(filename, "rb"); |
145 result = ov_open(oggFile, &oggStream, NULL, 0); |
148 result = ov_open(oggFile, &oggStream, NULL, 0); |
146 //TODO: check returning value of result |
149 //TODO: check returning value of result |
147 |
150 |