Harmony
Scripting Interface Documentation
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 (int 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 os 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...
 

Public Member Functions

 sound (QObject *parent, char *name)
 
virtual void attach (TUScriptInterfaceImpl *impl)
 

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());

Constructor & Destructor Documentation

◆ sound()

sound::sound ( QObject *  parent,
char *  name 
)

Member Function Documentation

◆ attach()

virtual void sound::attach ( TUScriptInterfaceImpl *  impl)
virtual

◆ 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.

◆ 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
fromFramesoundtrack start frame
toFramesoundtrack end frame
Returns
soundtrack WAV file

◆ getSoundtrackAll

QObject sound::getSoundtrackAll ( )
slot

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

Returns
soundtrack WAV file

◆ isUnicode

bool sound::isUnicode ( String  exportFilePath)
slot

Check if the export file path os 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
countaudio channel count

◆ setChannelSize

void sound::setChannelSize ( int  size)
slot

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

Parameters
sizeaudio channel size

◆ setFrameRate

void sound::setFrameRate ( int  rate)
slot

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

Parameters
rateframe rate

◆ setSampleRate

void sound::setSampleRate ( double  rate)
slot

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

Parameters
rateaudio 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