mathieu@14
|
1 % SimScene is a set of Matlab functions dedicated to the simulation of acoustic scenes.
|
mathieu@14
|
2 % This tool is specifically tailored to the evaluation of machine listening systems.
|
mathieu@14
|
3 % Thus, extensive and precise annotation of the scene content is provided together with the simulated scene.
|
mathieu@14
|
4 %
|
mathieu@14
|
5 % This tool is a research tool, provided as-is with the hope that it will be
|
mathieu@14
|
6 % useful and easy to adapt to the needs of others. Do not hesitate to provide
|
mathieu@14
|
7 % us with feedback at the following mail address: mathieu.lagrange@cnrs.fr
|
mathieu@14
|
8 %
|
mathieu@14
|
9 % SimScene have been tested on Matlab R2013b. The input audio files must be sampled at 44100 Hz.
|
mathieu@14
|
10
|
mathieu@14
|
11 % clear all;
|
mathieu@14
|
12 % close all;
|
mathieu@14
|
13
|
mathieu@14
|
14 inputPath='./sound/';
|
mathieu@14
|
15 outputPath='./results/';
|
mathieu@14
|
16
|
mathieu@14
|
17 %% timeMode: 'generate' -- ebrMode: 'generate'
|
mathieu@14
|
18
|
mathieu@14
|
19 timeMode='generate';
|
mathieu@14
|
20 ebrMode='generate';
|
mathieu@14
|
21 sceneDuration=15;
|
mathieu@14
|
22
|
mathieu@14
|
23 score.sceneDuration=sceneDuration;
|
mathieu@14
|
24 score.backgrounds={{'forest','forest', 1}};
|
mathieu@14
|
25 score.events={{'alouette','alouette', 12, 0, 2, 0.1, 1, 10, 0, 0},...
|
mathieu@14
|
26 {'bulbul' ,'bulbul' , 6 , 0, 2, 0, 3, 13, 0, 0},...
|
mathieu@14
|
27 {'geai' ,'geai' , 6 , 0, 1, 0.25, 5, 10, 0, 0}};
|
mathieu@14
|
28
|
mathieu@14
|
29 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode];
|
mathieu@14
|
30 disp(sceneId);
|
mathieu@14
|
31
|
mathieu@14
|
32 simScene(inputPath,outputPath,score,...
|
mathieu@14
|
33 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId);
|
mathieu@14
|
34
|
mathieu@14
|
35 %% timeMode: 'replicate' -- ebrMode: 'replicate'
|
mathieu@14
|
36
|
mathieu@14
|
37 instanceAnnotFile='./scene2Replicate/forest.txt';
|
mathieu@14
|
38 instanceAudioFile='./scene2Replicate/forest.wav';
|
mathieu@14
|
39
|
mathieu@14
|
40 timeMode='replicate';
|
mathieu@14
|
41 ebrMode='replicate';
|
mathieu@14
|
42 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode];
|
mathieu@14
|
43 disp(sceneId);
|
mathieu@14
|
44
|
mathieu@14
|
45 score.backgrounds={{'forest','forest', 1}};
|
mathieu@14
|
46
|
mathieu@14
|
47 score.events={{'alouette','', -3, 0, 0, 0, 0, 0, 0, 0},... % Only change <ebr>
|
mathieu@14
|
48 {'bulbul','', 3, 0, 0, 0, 6, 0, 0, 0}}; % Change <ebr> and <start_time>
|
mathieu@14
|
49
|
mathieu@14
|
50 % If score.event is of length 1 and <label>='', offsets will be used for all classes.
|
mathieu@14
|
51 % score.events={{'','',-6,0,0,0,0,0,0,0}}; % Change <ebr> for the three sound classes of bird.
|
mathieu@14
|
52
|
mathieu@14
|
53 simScene(inputPath,outputPath,score,...
|
mathieu@14
|
54 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId,...
|
mathieu@14
|
55 'instanceAnnotFile',instanceAnnotFile,'instanceAudioFile',instanceAudioFile);
|
mathieu@14
|
56
|
mathieu@14
|
57 %% timeMode: 'abstract' -- ebrMode: 'abstract'
|
mathieu@14
|
58
|
mathieu@14
|
59 instanceAnnotFile='./scene2Replicate/forest.txt';
|
mathieu@14
|
60 instanceAudioFile='./scene2Replicate/forest.wav';
|
mathieu@14
|
61
|
mathieu@14
|
62 timeMode='abstract';
|
mathieu@14
|
63 ebrMode='abstract';
|
mathieu@14
|
64 sceneId = ['demo_forest_timeMode_' timeMode '_ebrMode_' ebrMode];
|
mathieu@14
|
65 disp(sceneId);
|
mathieu@14
|
66
|
mathieu@14
|
67 score.backgrounds={{'forest','forest', 1}};
|
mathieu@14
|
68 score.events={{'geai','', -3, 0, 5, 0, 1, 0, 0, 0}}; % Change <ebr>, <mean_time_between_instances> and <start_time>
|
mathieu@14
|
69
|
mathieu@14
|
70 simScene(inputPath,outputPath,score,...
|
mathieu@14
|
71 'timeMode',timeMode,'ebrMode',ebrMode,'outputFileName',sceneId,...
|
mathieu@14
|
72 'instanceAnnotFile',instanceAnnotFile,'instanceAudioFile',instanceAudioFile); |