ScummVM API documentation
global_audio.h
1/* ScummVM - Graphic Adventure Engine
2 *
3 * ScummVM is the legal property of its developers, whose names
4 * are too numerous to list here. Please refer to the COPYRIGHT
5 * file distributed with this source distribution.
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 *
20 */
21
22#ifndef AGS_ENGINE_AC_GLOBAL_AUDIO_H
23#define AGS_ENGINE_AC_GLOBAL_AUDIO_H
24
25#include "ags/engine/ac/speech.h"
26
27namespace AGS3 {
28
29void StopAmbientSound(int channel);
30void PlayAmbientSound(int channel, int sndnum, int vol, int x, int y);
31int IsChannelPlaying(int chan);
32int IsSoundPlaying();
33// returns -1 on failure, channel number on success
34int PlaySoundEx(int val1, int channel);
35void StopAllSounds(int evenAmbient);
36
37void PlayMusicResetQueue(int newmus);
38void SeekMIDIPosition(int position);
39int GetMIDIPosition();
40int IsMusicPlaying();
41int PlayMusicQueued(int musnum);
42void scr_StopMusic();
43void SeekMODPattern(int patnum);
44void SeekMP3PosMillis(int posn);
45int GetMP3PosMillis();
46void SetMusicVolume(int newvol);
47void SetMusicMasterVolume(int newvol);
48void SetSoundVolume(int newvol);
49void SetChannelVolume(int chan, int newvol);
50void SetDigitalMasterVolume(int newvol);
51int GetCurrentMusic();
52void SetMusicRepeat(int loopflag);
53void PlayMP3File(const char *filename);
54void PlaySilentMIDI(int mnum);
55
56void SetSpeechVolume(int newvol);
57void SetVoiceMode(int newmod);
58int GetVoiceMode();
59int IsVoxAvailable();
60int IsMusicVoxAvailable();
61
62struct CharacterInfo;
63struct ScriptAudioChannel;
64// Starts voice-over playback and returns audio channel it is played on;
65// as_speech flag determines whether engine should apply speech-related logic
66// as well, such as temporary volume reduction.
67ScriptAudioChannel *PlayVoiceClip(CharacterInfo *ch, int sndid, bool as_speech);
68
69//=============================================================================
70// Play voice-over for the active blocking speech and initialize relevant data
71bool play_voice_speech(int charid, int sndid);
72// Play voice-over clip in non-blocking manner
73bool play_voice_nonblocking(int charid, int sndid, bool as_speech);
74// Stop voice-over for the active speech and reset relevant data
75void stop_voice_speech();
76// Stop non-blocking voice-over and revert audio volumes if necessary
77void stop_voice_nonblocking();
78
79} // namespace AGS3
80
81#endif