void AudioHandler::loadMusic(const std::string& musicFile) { /* Purpose: Load the music assets into memory. */ loadAudio(musicFile, Music); }
void AudioHandler::loadSound(const std::string& soundFile) { /* Purpose: Load the sound assets into memory. */ loadAudio(soundFile, Sound); }
JS_BINDED_FUNC_IMPL(FakeAudio, play) { if (!loaded) { loadAudio(); } alSourcePlay(sourceId); return JS_TRUE; }
void WFStartupAudioScripts::EventCallback(int32 eventType, WFStartupEventCallbackParameter* param) { /* Send request to load the audio syntax stuff, but don't bother */ /* about the reply, it is not interesting for us. */ /* Thus, the reply will be handled by the AppUi. */ isab::GenericGuiMess loadAudio(isab::GuiProtEnums::LOAD_AUDIO_SYNTAX, m_audioPath); m_sender->SendMessage(loadAudio); }
void CasparDevice::playAudio(int channel, int videolayer, const QString& name, const QString &transition, int duration, const QString& easing, const QString& direction, bool loop, bool useAuto) { if (useAuto) loadAudio(channel, videolayer, name, transition, duration, easing, direction, loop, useAuto); else writeMessage(QString("PLAY %1-%2 \"%3\" %4 %5 %6 %7 %8") .arg(channel).arg(videolayer).arg(name).arg(transition).arg(duration).arg(easing) .arg(direction) .arg((loop == true) ? "LOOP" : "")); }
Player::Player(World * world, sf::Window * window) { this->world = world; this->window = window; current = { (float) -world->initialPlayerPosition.x, 0, (float) -world->initialPlayerPosition.y, 0, 0 }; camera = ThirdPerson; C3DObject_Load_New_Player("resource/drone/drone.obj", &playerModel); loadAudio(); }
/** \fn decodeStreamHeader */ bool asfHeader::decodeStreamHeader(asfChunk *s) { uint8_t gid[16]; // Client GID uint32_t audiovideo=0; // video=1, audio=2, 0=unknown uint32_t sid; s->read(gid,16); printf("Type :"); for(int z=0;z<16;z++) printf("0x%02x,",gid[z]); if(!memcmp(gid,asf_video,16)) { printf("(video)"); audiovideo=1; } else { if(!memcmp(gid,asf_audio,16)) { printf("(audio)"); audiovideo=2; } else printf("(? ? ? ?)"); } printf("\nConceal :"); for(int z=0;z<16;z++) printf(":%02x",s->read8()); printf("\n"); printf("Reserved : %08"PRIx64"\n",s->read64()); printf("Total Size : %04"PRIx32"\n",s->read32()); printf("Size : %04"PRIx32"\n",s->read32()); sid=s->read16(); printf("Stream nb : %04d\n",sid); printf("Reserved : %04"PRIx32"\n",s->read32()); switch(audiovideo) { case 1: // Video { if(_videoIndex==-1) // take the 1st video track { _videoIndex=sid; _videoStreamId= sid; if(!loadVideo(s)) { return 0; } ADM_info("Average fps available from ext header\n"); } } break; case 2: // audio loadAudio(s,sid); break; default: break; } return true; }
/* return: qtrue => noDataTransferred */ static qboolean loadFrame(void) { qboolean anyDataTransferred = qtrue; qboolean needVOutputData = qtrue; // qboolean audioSDone = qfalse; // qboolean videoSDone = qfalse; qboolean audioWantsMoreData = qfalse; int status; while( anyDataTransferred && (needVOutputData || audioWantsMoreData) ) { anyDataTransferred = qfalse; // xvid -> "gl" ? videoDone : needPacket // vorbis -> raw sound ? audioDone : needPacket // anyDataTransferred = videoDone && audioDone; // needVOutputData = videoDone && audioDone; // if needPacket { // videoStream -> xvid ? videoStreamDone : needPage // audioSteam -> vorbis ? audioStreamDone : needPage // anyDataTransferred = audioStreamDone && audioStreamDone; if(needVOutputData && (status=loadVideoFrame())) { needVOutputData = qfalse; if(status>0) anyDataTransferred = qtrue; else anyDataTransferred = qfalse; // error (we don't need any videodata and we had no transferred) } // if needPage if(needVOutputData || audioWantsMoreData) { // try to transfer Pages to the audio- and video-Stream if(loadPagesToStreams()) { // try to load a datablock from file anyDataTransferred |= !loadBlockToSync(); } else anyDataTransferred = qtrue; // successful loadPagesToStreams() } // load all Audio after loading new pages ... if(g_ogm.VFrameCount>1) // wait some videoframes (it's better to have some delay, than a lagy sound) audioWantsMoreData = loadAudio(); } } // ogg_packet_clear(&op); return !anyDataTransferred; }
JS_BINDED_PROP_SET_IMPL(FakeAudio, src) { if (vp.isString()) { JSString* str = vp.toString(); JSStringWrapper wrapper(str); src = (const char *)wrapper; if (preload) { loadAudio(); } return JS_TRUE; } JS_ReportError(cx, "Invalid source for Audio"); return JS_FALSE; }
//-------------------------------------------------------------- void testApp::dragEvent(ofDragInfo dragInfo){ for (int i = 0; i < dragInfo.files.size(); i++) { loadAudio(dragInfo.files[i]); } }
JS_BINDED_FUNC_IMPL(FakeAudio, load) { loadAudio(); return JS_TRUE; }
// ----------------------------------------------- // Desc: Get the audio Name and Path, ready to load. // ----------------------------------------------- Sound::Sound(const tchar* audioPath) { loadAudio(audioPath); }
//-------------------------------------------------------------- void testApp::dragEvent(ofDragInfo dragInfo){ loadAudio(dragInfo.files[0]); }