sound Class Reference

The sound JavaScript global object. Access the scene soundtrack in part or in whole. The scripting environment can receive notifications when scene frame is ready. See the TB_ExportFLV.js script for an example. More...

Public Slots

void setFrameRate (double rate)
 Sets the number of frames per second. By default the scene frame rate is used. More...
 
void setSampleRate (double rate)
 Sets the audio sample rate in Hz (i.e. 22050, 44100, ...). More...
 
void setChannelSize (int size)
 Sets the audio channel size (i.e. 8 or 16 bit). More...
 
void setChannelCount (int count)
 Sets the number of audio channels (i.e 1 for mono and 2 for stereo). More...
 
QObject getSoundtrack (int fromFrame, int toFrame)
 Return a part of the scene's soundtrack in a temporary file in the WAV format. More...
 
QObject getSoundtrackAll ()
 Return the scene's soundtrack in a temporary file in the WAV format. More...
 
bool isUnicode (String exportFilePath)
 Check if the export file path is in unicode. More...
 
bool copy (String &srcFileName, String &dstFileName)
 Copy the content of the source file to the destination file and say if the copy is done completely. More...
 

Signals

void soundReady ()
 Event that notifies the script when the sound file is available. More...
 

Friends

class SCR_SoundController
 

Detailed Description

The sound JavaScript global object. Access the scene soundtrack in part or in whole. The scripting environment can receive notifications when scene frame is ready. See the TB_ExportFLV.js script for an example.

// Retrieves a 16 bit 48 KHz stereo soundtrack of frames 50 to 100
var soundFile = sound.getSoundtrack(50, 100);
MessageBox.information("Soundtrack file location: " + soundFile.path());

Member Function Documentation

◆ copy

bool sound::copy ( String &  srcFileName,
String &  dstFileName 
)
slot

Copy the content of the source file to the destination file and say if the copy is done completely.

Parameters
srcFileName: The source file to be copied from.
dstFileName: The destination file to be copied to.
Returns
Returns true if successful.

◆ getSoundtrack

QObject sound::getSoundtrack ( int  fromFrame,
int  toFrame 
)
slot

Return a part of the scene's soundtrack in a temporary file in the WAV format.

Parameters
fromFrame: The soundtrack start frame.
toFrame: The soundtrack end frame.
Returns
Returns the soundtrack WAV file.

◆ getSoundtrackAll

QObject sound::getSoundtrackAll ( )
slot

Return the scene's soundtrack in a temporary file in the WAV format.

Returns
Returns the soundtrack WAV file.

◆ isUnicode

bool sound::isUnicode ( String  exportFilePath)
slot

Check if the export file path is in unicode.

Parameters
exportFilePath: The export file path to check.
Returns
Returns true if the export file path is in unicode.

◆ setChannelCount

void sound::setChannelCount ( int  count)
slot

Sets the number of audio channels (i.e 1 for mono and 2 for stereo).

Parameters
count: The audio channel count.

◆ setChannelSize

void sound::setChannelSize ( int  size)
slot

Sets the audio channel size (i.e. 8 or 16 bit).

Parameters
size: The audio channel size.

◆ setFrameRate

void sound::setFrameRate ( double  rate)
slot

Sets the number of frames per second. By default the scene frame rate is used.

Parameters
rate: The desired frame rate.

◆ setSampleRate

void sound::setSampleRate ( double  rate)
slot

Sets the audio sample rate in Hz (i.e. 22050, 44100, ...).

Parameters
rate: The desired audio sample rate.

◆ soundReady

void sound::soundReady ( )
signal

Event that notifies the script when the sound file is available.

Friends And Related Function Documentation

◆ SCR_SoundController

friend class SCR_SoundController
friend