14.2 Sound recording network sample

Four kinds of sound recording network samples are available as shown in Table 14.2. The left column indicates network files and the right column indicates processing contents.

Table 14.2: Sound recording network list.

Network file name

Processing content

demoALSA_2ch.n

Stereo sound recording

demoWS_8ch.n

Sound recording for eight channels with RASP

demoTDBD_8ch.n

Sound recording for eight channels with TD-BD-16AD-USB

demoRASP24_8ch.n

Sound recording for eight channels with RASP24

Figure 14.2: Execution example of demoALSA1ch.sh.
$>$ demoALSA_2ch.n 100
UINodeRepository Scan()
Scanning def /usr/lib/flowdesigner/toolbox
done loading def files
loading XML document from memory
done!
Building network MAIN

$<$Bool 1 $>$

Note that the difference between these networks is only the parameters of AudioStreamFromMic module. The DEVICE parameter (plughw:1,0, 127.0.0.1, etc.) changes according to an environment. Therefore, an user has to set correct value.

A sample network consists of two sub-networks (MAIN, MAIN_LOOP). MAIN (subnet) and MAIN_LOOP (iterator) have one and six modules, separately. Figure 14.3 and 14.4 shows MAIN (subnet) and MAIN_LOOP (iterator). It is simple network configuration in which the audio waveforms collected in the AudioStreamFromMic module are selected in ChannelSelector , and written in files in SaveWavePCM . The SaveWavePCM module connected to OUTPUT1 saves a file with eight channel signal. The other SaveWavePCM module saves eight files with each channel signal.

Iterate is a module that indicates that the execution is repeated for the number of times set by the user. Designate the number of frames to be collected and adjust sound recording time.

\includegraphics{fig/recipes/demo-Record-MAIN.png}
Figure 14.3: MAIN (subnet)
\includegraphics[width=\textwidth ,clip]{fig/recipes/demo-Record-MAIN_LOOP.png}
Figure 14.4: MAIN_LOOP (iterator)

There are five properties for the MAIN_LOOP module in MAIN (subnet). Table 14.3 shows a list of them. SAMPLING_RATE and GET_FRAMES are important. Each parameter value is set according to the values in the table. Set value of GET_FRAMES is 1 here. This means the monobasic argument of demoALSA_2ch.n casted to the integral type and substituted. The number of sound recording frames is given to this argument in demoALSA_2ch.n in demoALSA_2ch.sh. Designate sound recording time length as the number of frames acquired and the actual sound recording time length is expressed in sec as follows.

  $\displaystyle  $ $\displaystyle  $ $\displaystyle  ( LENGTH + (GET\_ FRAMES - 1) * ADVANCE ) / SAMPLING\_ RATE  $   (1)
Table 14.3: Parameter list of MAIN_LOOP

Parameter name

Type

Set value

Unit

Description

ADVANCE

int 

160

[pt]

Shift Length

LENGTH

int 

512

[pt]

FFT length

SAMPLING_RATE

int 

16000

[Hz]

Sampling frequency

GET_FRAMES

subnet_param 

1

 

Number of frames for sound recording

DOWHILE

bool 

   

Blank