MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / StreamPlay

Function StreamPlay

stream_audio/streamaudio.cpp:946–960  ·  view source on GitHub ↗

these functions are the 'simplified' stream interface from Jeff (most of this code is from Jeff)

Source from the content-addressed store, hash-verified

944}
945// these functions are the 'simplified' stream interface from Jeff (most of this code is from Jeff)
946int StreamPlay(const char *filename, float volume, int flags) {
947 int retval = -1;
948 try {
949 flags = 0;
950 User_audio_stream.Close();
951 User_audio_stream.Open(filename, STRM_OPNF_ONETIME);
952 Stream_volume = volume;
953 User_audio_stream.SetVolume(Stream_volume * Stream_master_volume);
954 User_audio_stream.Play(true); // start this stream on the next frame.
955 retval = User_audio_stream.m_streamindex;
956 } catch (...) {
957 return -1;
958 }
959 return retval;
960}
961void StreamStop(int handle) {
962 if (handle > -1) {
963 if (AudioStream::m_streams[handle])

Callers 4

OnDblclkStrmAudioListMethod · 0.85
msafe_CallFunctionFunction · 0.85
taunt_PlayTauntFileFunction · 0.85
StartVoiceFunction · 0.85

Calls 4

CloseMethod · 0.45
OpenMethod · 0.45
SetVolumeMethod · 0.45
PlayMethod · 0.45

Tested by

no test coverage detected