#include <hssSpeaker.h>
Use this class to open/close/supend/resume sound output and to play sounds.
Public Member Functions | |
| HSS_API_H s32 | bufferLength (s32 ms) |
| Sets the internal mixing buffer length. | |
| HSS_API_H s32 | bufferLength () |
| Returns the internal mixing buffer length. | |
| HSS_API_H s32 | open (u32 freqmix, u32 bps, bool stereo, u32 maxmodchannels=MUSIC_MIN, u32 maxsfxchannels=SOUND_MIN) |
| Initialize the Hekkus Sound System. | |
| HSS_API_H s32 | close () |
| Shut down the Hekkus Sound System. | |
| HSS_API_H void | suspend () |
| Suspend sound output. | |
| HSS_API_H void | resume () |
| Resume sound output. | |
| HSS_API_H hssChannel * | channel (s32 chl) |
| Get a playing or paused channel. | |
| HSS_API_H u32 | maxChannelMusics () |
| Get the total number of Music channels allocated. | |
| HSS_API_H u32 | maxChannelSounds () |
| Get the total number of Sound channels allocated. | |
| HSS_API_H u32 | playingChannelMusics () |
| Get the number of Music channels that are playing. | |
| HSS_API_H u32 | playingChannelSounds () |
| Get the number of Sound channels that are playing. | |
| HSS_API_H s32 | playSound (hssSound *sndfx, u32 channelAndFlags=HSS_PLAY_FREE) |
| Play a Sound on the first Sound channel available. | |
| HSS_API_H void | stopSounds () |
| Stop all playing and paused Sound channels. | |
| HSS_API_H void | pauseSounds () |
| Pause all playing Sound channels. | |
| HSS_API_H void | unpauseSounds () |
| Unpause all paused Sound channels. | |
| HSS_API_H s32 | playMusic (hssMusic *mod, u32 channelAndFlags=HSS_PLAY_FREE) |
| Play a Music on the first Music channel available. | |
| HSS_API_H void | stopMusics () |
| Stop all playing and paused Music channels. | |
| HSS_API_H void | pauseMusics () |
| Pause all playing Music channels. | |
| HSS_API_H void | unpauseMusics () |
| Unpause all paused Music channels. | |
| HSS_API_H void | volumeSounds (u32 v) |
| Set master Souns volume. | |
| HSS_API_H u32 | volumeSounds () |
| Get master Sound volume. | |
| HSS_API_H void | volumeMusics (u32 v) |
| Set master Music volume. | |
| HSS_API_H u32 | volumeMusics () |
| Get master Music volume. | |
| HSS_API_C s32 hssSpeaker::bufferLength | ( | s32 | ms | ) |
Sets the internal mixing buffer length.
This function must be called before to open the Speaker object or it will fail.
| ms | length in milliseconds. |
| HSS_API_C s32 hssSpeaker::bufferLength | ( | ) |
Returns the internal mixing buffer length.
| HSS_API_C s32 hssSpeaker::open | ( | u32 | freqmix, | |
| u32 | bps, | |||
| bool | stereo, | |||
| u32 | maxmodchannels = MUSIC_MIN, |
|||
| u32 | maxsfxchannels = SOUND_MIN | |||
| ) |
Initialize the Hekkus Sound System.
Open sound output at freqmix, setup a thread for sound update and alloc specified channels.
Symbian Series 60 phones supports only 8000hz and 16000hz 16bit mono output.
| freqmix | output rate in hz. | |
| bps | select 16 or 8 bit output. | |
| stereo | enable stereo output (true == stereo, false == mono). | |
| maxmodchannels | maximum number of ProTracker channels available. | |
| maxsfxchannels | maximum number of Wave channels available. |
| HSS_API_C s32 hssSpeaker::close | ( | ) |
Shut down the Hekkus Sound System.
All sounds are stopped, thread are deallocated.
You have however manually deallocated all Sounds and Musics previous allocated.
| HSS_API_C void hssSpeaker::suspend | ( | ) |
Suspend sound output.
Suspend all sounds, thread and sound output. Call it when your app are minimized or lose focus.
| HSS_API_C void hssSpeaker::resume | ( | ) |
Resume sound output.
Resume all sounds, thread and sound output. Call it when your app regain focus after a suspend call.
| HSS_API_C hssChannel * hssSpeaker::channel | ( | s32 | chl | ) |
Get a playing or paused channel.
| chl | channel number to get. Should be a vaule returned from playSound() or playMusic() function. |
| HSS_API_C u32 hssSpeaker::maxChannelMusics | ( | ) |
Get the total number of Music channels allocated.
| HSS_API_C u32 hssSpeaker::maxChannelSounds | ( | ) |
Get the total number of Sound channels allocated.
| HSS_API_C u32 hssSpeaker::playingChannelMusics | ( | ) |
Get the number of Music channels that are playing.
| HSS_API_C u32 hssSpeaker::playingChannelSounds | ( | ) |
Get the number of Sound channels that are playing.
| HSS_API_C s32 hssSpeaker::playSound | ( | hssSound * | sndfx, | |
| u32 | channelAndFlags = HSS_PLAY_FREE | |||
| ) |
Play a Sound on the first Sound channel available.
Play a Sound using the sample's default volume and loop settings. If all the Sound channels are playing this sound will discarded and not played.
| sndfx | Pointer to the Sound to be played. | |
| channelAndFlags | Specify the channel that will play the sound. Use HSS_PLAY_FREE if you want the first channel available. You can 'or' HSS_PLAY_PAUSED if you want to start the sound paused. |
| HSS_API_C void hssSpeaker::stopSounds | ( | ) |
Stop all playing and paused Sound channels.
All stopped channels will be available for other play.
| HSS_API_C void hssSpeaker::pauseSounds | ( | ) |
Pause all playing Sound channels.
| HSS_API_C void hssSpeaker::unpauseSounds | ( | ) |
Unpause all paused Sound channels.
| HSS_API_C s32 hssSpeaker::playMusic | ( | hssMusic * | mod, | |
| u32 | channelAndFlags = HSS_PLAY_FREE | |||
| ) |
Play a Music on the first Music channel available.
Play a Music using the music's default volume and loop settings. If all the Music channels are playing this sound will be discarded and not played.
| mod | Pointer to the Music to be played. | |
| channelAndFlags | Specify the channel that will play the music. Use HSS_PLAY_FREE if you want the first channel available. You can 'or' HSS_PLAY_PAUSED if you want to start the music paused. |
| HSS_API_C void hssSpeaker::stopMusics | ( | ) |
Stop all playing and paused Music channels.
All stopped channels will be available for other play.
| HSS_API_C void hssSpeaker::pauseMusics | ( | ) |
Pause all playing Music channels.
| HSS_API_C void hssSpeaker::unpauseMusics | ( | ) |
Unpause all paused Music channels.
| HSS_API_C void hssSpeaker::volumeSounds | ( | u32 | v | ) |
Set master Souns volume.
This value affect ALL Sound channels.
| v | new master Sound volume. Can vary from 0 to 64. 0 = silence, 64 = full volume. |
| HSS_API_C u32 hssSpeaker::volumeSounds | ( | ) |
Get master Sound volume.
| HSS_API_C void hssSpeaker::volumeMusics | ( | u32 | v | ) |
Set master Music volume.
This value affect ALL Music channels.
| v | new master Music volume. Can vary from 0 to 64. 0 = silence, 64 = full volume. |
| HSS_API_C u32 hssSpeaker::volumeMusics | ( | ) |
Get master Music volume.
1.5.1-p1