6.1.6 PlayAudio

6.1.6.1 Outline of the node

This node plays the waveform data.

6.1.6.2 Necessary files

No files are required.

6.1.6.3 Usage

When to use

This node is used when wishing to listen to the separated speech waveform data or the recorded waveform data from microphones.

Typical connection

Figure 6.12 and Figure 6.13 show example usages of the PlayAudio node.

Figure 6.12 shows the example usage of listening to the separated speech waveform data. The separated speech waveform data can be calculated by the GHDSS node and the Synthesize node. When you use the stereo device, the waveform data for L channel should be input to INPUT1, and the waveform data for R channel should be input to INPUT2. When the waveform data is the multichannel data, the waveform data of all channel are mixed in each channel.

Figure 6.13 shows the example usage of listening to the recorded waveform data from microphones. The multichannel waveform data taken by AudioStreamFromWave should be input to INPUT_MULTI_CHANNEL. The assignment to the output channel is set using the MULTI_CHANNEL_ASSIGN parameter.

\includegraphics[width=.9\textwidth ]{fig/modules/PlayAudio-connection1}
Figure 6.12: Connection example of PlayAudio  1

\includegraphics[width=.9\textwidth ]{fig/modules/PlayAudio-connection2}
Figure 6.13: Connection example of PlayAudio  2

6.1.6.4 Input-output and property of the node

Table 6.15: Parameter list of PlayAudio 

Parameter name

Type

Default value

Unit

Description

MASTER_VOLUME

float 

0

[dB]

Master volume of PlayAudio node.

DEVICE

int 

   

The device index for playing. When this parameter is empty, PlayAudio uses the default device.

CHANNNEL_COUNT

int 

2

 

The number of channel for playing. The maximum value of this parameter is 2.

MULTI_CHANNEL_ASSIGN

Vector<int> 

See below.

 

The assignment to the output channel. This parameter is used with INPUT_MULTI_CHANNEL.

LATENCY

int 

1000

[msec]

The delay time for the stable playing.

LENGTH

int 

512

[pt]

FFT length

ADVANCE

int 

160

[pt]

Shift length

SAMPLING_RATE

int 

16000

[Hz]

Sampling rate

Input

INPUT1

: Matrix<float> , Map<int, ObjectRef> or Vector<float> type. ObjectRef of Map<int, ObjectRef> is Vector<float> . The waveform data for the channel 1 of the sound device. When the waveform data is the multichannel data, the waveform data of all channel are mixed.

INPUT2

: Matrix<float> , Map<int, ObjectRef> or Vector<float> type. ObjectRef of Map<int, ObjectRef> is Vector<float> . The waveform data for the channel 2 of the sound device. When the waveform data is the multichannel data, the waveform data of all channel are mixed.

INPUT_MULTI_CHANNEL

: Matrix<float> or Map<int, ObjectRef> type. The assignment to the output channel is set using the MULTI_CHANNEL_ASSIGN parameter.

Output

OUTPUT

: Matrix<float> type. The waveform data for the output channels. This data is not affected by LATENCY parameter.

Parameter

MASTER_VOLUME

: float type. Master volume of PlayAudio node.

DEVICE

: int type. The device index for playing. When this parameter is empty, PlayAudio uses the default device.

CHANNNEL_COUNT

: int type. The number of channel for playing. The maximum value of this parameter is 2.

MULTI_CHANNEL_ASSIGN

: Vector<int> type. The assignment to the output channel. This parameter is used with INPUT_MULTI_CHANNEL. You should set the index or ID of the input data for the output channel. For example, when you wish to listen to the index 1 and 2 of the Matrix<float> , you should set this parameter <Vector<int> 1 2> . When the element of this parameter is larger than the size of Matrix<float> , PlayAudio plays the waveform data of the available channel, and PlayAudio shows the actual parameters. When this parameter is empty, PlayAudio plays the waveform data of the higher index with the number of the output channel.

LATENCY

: int type. The delay time for the stable playing.

LENGTH

: int type. FFT length; must be equal to the other node(AudioStreamFromMic , MultiFFT ).

ADVANCE

: int type. Shift length; must be equal to the other node(AudioStreamFromMic , MultiFFT ).

SAMPLING_RATE

: int type. Sampling rate; must be equal to the other node(AudioStreamFromMic , MultiFFT ).

6.1.6.5 Details of the node

You should use either INPUT# or INPUT_MUITI_CHANNEL. When both INPUT# and INPUT_MUITI_CHANNEL are used, PlayAudio plays the mixed data.

Only one PlayAudio can be placed in the network file.

To change the assinment to the output channel:

When INPUT1 and INPUT2 is used, you should replace the connection. When INPUT_MUITI_CHANNEL is used, you should change the MULTI_CHANNEL_ASSIGN parameter.

To show the list of the output sound device:

The device list index can be shown by “Output Sound Device List”, which is provided by HARK. If you want to use Output Sound Device List, click [Start] $\rightarrow $ [Programs] $\rightarrow $ [HARK] $\rightarrow $ [Output Sound Device List]. Then, it lists up all the name of sound devices connected to your PC like Figure 6.14.

\includegraphics[width=.8\textwidth ]{fig/modules/PlayAudio-outputdevlist}
Figure 6.14: Output sound device list