Script
Public Slots | Signals | Public Member Functions | Friends | List of all members
sound Class Reference

The Sound class is used to access the scene's soundtrack in part or in whole. The scripting environment can receive notifications when scene frame is ready. See the TB_ExportFLV script for an example. More...

#include <soundinterface.h>

Inheritance diagram for sound:
Inheritance graph
[legend]
Collaboration diagram for sound:
Collaboration graph
[legend]

Public Slots

void setFrameRate (int rate)
 Sets the number of frames per second. By default the scene frame rate is used.
 
void setSampleRate (double rate)
 Sets the audio sample rate in Hz (i.e. 22050, 44100, ...).
 
void setChannelSize (int size)
 Sets the audio channel size (i.e. 8 or 16 bit).
 
void setChannelCount (int count)
 Sets the number of audio channels (i.e 1 for mono and 2 for stereo).
 
QObject getSoundtrack (int fromFrame, int toFrame)
 Return a part of the scene's soundtrack in a temporary file in the WAV format.
 
QObject getSoundtrackAll ()
 Return the scene's soundtrack in a temporary file in the WAV format.
 
bool isUnicode (String exportFilePath)
 Check if the export file path os in unicode.
 
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.
 

Signals

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

Public Member Functions

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

Friends

class SCR_SoundController
 

Detailed Description

The Sound class is used to access the scene's soundtrack in part or in whole. The scripting environment can receive notifications when scene frame is ready. See the TB_ExportFLV script for an example.

You can use it in Script Editor only.

// 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 ( QObject *  parent,
char *  name 
)

Member Function Documentation

virtual void sound::attach ( TUScriptInterfaceImpl *  impl)
virtual
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.

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
QObject sound::getSoundtrackAll ( )
slot

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

Returns
soundtrack WAV file
bool sound::isUnicode ( String  exportFilePath)
slot

Check if the export file path os in unicode.

void sound::setChannelCount ( int  count)
slot

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

Parameters
sizeaudio channel count
void sound::setChannelSize ( int  size)
slot

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

Parameters
sizeaudio channel size
void sound::setFrameRate ( int  rate)
slot

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

Parameters
rateframe rate
void sound::setSampleRate ( double  rate)
slot

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

Parameters
rateaudio sample rate
void sound::soundReady ( )
signal

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

Friends And Related Function Documentation

friend class SCR_SoundController
friend

The documentation for this class was generated from the following file: