Changeset 708 for code/branches/FICN/src/audio/AudioStream.cc
- Timestamp:
- Dec 28, 2007, 10:30:29 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/audio/AudioStream.cc
r677 r708 28 28 29 29 #include "AudioStream.h" 30 #include " ../orxonox/core/Debug.h"30 #include "orxonox/core/Debug.h" 31 31 32 32 namespace audio 33 33 { 34 AudioStream::AudioStream( std::string path)34 AudioStream::AudioStream(orxonox::String path) 35 35 { 36 36 this->path = path; … … 40 40 void AudioStream::open() 41 41 { 42 int result; 43 44 45 if(!(oggFile = fopen(path.c_str(), "rb"))) 42 //int result; 43 errno_t result; 44 45 46 if(fopen_s(&oggFile, path.c_str(), "rb")) 46 47 { 47 48 orxonox::Error("Could not open Ogg file "+path); 48 49 return; 49 50 } 50 51 if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 51 else 52 { 53 COUT(4) << "Opened Ogg file" << path << std::endl; 54 } 55 56 /*if((result = ov_open(oggFile, &oggStream, NULL, 0)) < 0) 52 57 { 53 58 fclose(oggFile); 54 59 orxonox::Error("Could not open Ogg stream. " + errorString(result)); 55 60 return; 56 } 61 }*/ 57 62 58 63 loaded = true; … … 254 259 255 260 256 std::string AudioStream::errorString(int code)261 orxonox::String AudioStream::errorString(int code) 257 262 { 258 263 switch(code) 259 264 { 260 265 case OV_EREAD: 261 return std::string("Read from media.");266 return orxonox::String("Read from media."); 262 267 case OV_ENOTVORBIS: 263 return std::string("Not Vorbis data.");268 return orxonox::String("Not Vorbis data."); 264 269 case OV_EVERSION: 265 return std::string("Vorbis version mismatch.");270 return orxonox::String("Vorbis version mismatch."); 266 271 case OV_EBADHEADER: 267 return std::string("Invalid Vorbis header.");272 return orxonox::String("Invalid Vorbis header."); 268 273 case OV_EFAULT: 269 return std::string("Internal logic fault (bug or heap/stack corruption.");274 return orxonox::String("Internal logic fault (bug or heap/stack corruption."); 270 275 default: 271 return std::string("Unknown Ogg error.");276 return orxonox::String("Unknown Ogg error."); 272 277 } 273 278 }
Note: See TracChangeset
for help on using the changeset viewer.