Is it possible to find silence in audio files using Javascript?

I am working on a tool for recording speech recordings using Javascript. Basically, I hook up key events for playing, pausing and reading a tag file cyclically audio.

There are many modern desktop applications for this kind of thing (for example, Transcriber - here is a screenshot ). Most transcription tools have a built-in waveform that can be used to skip an audio file, which is very useful because a transcriptor can learn to visually find and repeat or create a phrase.

I am wondering if it is possible to emulate a subset of this function in a browser using Javascript. I am not very good at signal processing, perhaps this is not even possible.

But what I represent is Javascript reading the audio stream from a file and periodically measuring the amplitude. If the amplitude is very small longer than some timeline, then this will be transmitted as a phrase break.

Such labeling, I think, would be very useful for transcription. Then I could set up key commands to go to the previous period of silence. So, hypothetically (introducing a jQuery-based API):

var audio = $('audio#someid');

var silences = silenceFindingVoodoo(audio);

silencesthen it will contain a list of times, so I can connect some way so that the user can jump through different silences and then set currentTimeto the selected value and play it.

Javascript?

+3
5

, javascript (, , , ). :

https://developer.mozilla.org/En/Using_XMLHttpRequest#Handling_binary_data

... , , , , ( , , javascript). WAV , . (, MP3) javascript, , .

: , , , javascript, MP3, WAV. , , .

, MP3 WAV . , , . , , , , .

MP3 javascript , CBR ( ) VBR ( ).

+1

, JavaScript .

- - .

/ HTML5 , - . () ( - ), , JavaScript .

+1

WebWorker, Javascript, . , . , Javascript , , , .

, javascript canvas, . .

, . , , , , .

+1

, JavaScript - , , - . , javascript XML , , , . , XML:

... API , . , - ... .

+1

, Web Audio API, , AnalyserNode. , drawTimeDomain():

var threshold = 1000;
var sum = 0;
for (var i in amplitudeArray) {
    sum += Math.abs(128 - amplitudeArray[i]);
}
var test = (sum < threshold) ? 'silent' : 'sound';
console.log('silent info', test);

(, , 500 , )

0

Source: https://habr.com/ru/post/1718970/


All Articles