example.tsx
1const microm = new Microm();
2let mp3 = null;
3
4start();
5setTimeout(stop, 1500);
6
7function start() {
8 microm.record().then(function() {
9 console.log('recording...')
10 }).catch(function() {
11 console.log('error recording');
12 });
13}
14
15function stop() {
16 microm.stop().then(function(result) {
17 mp3 = result;
18 console.log(mp3.url, mp3.blob, mp3.buffer);
19
20 play();
21 download();
22 });
23}
24
25function play() {
26 microm.play();
27}
28
29function download() {
30 const fileName = 'cat_voice';
31 microm.download(fileName);
32}