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