Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Common APIs used by Noice Web applications to play sounds.

License

NotificationsYou must be signed in to change notification settings

trynoice/january

Repository files navigation

Noice Logo

Noice January

Node.jscodecov

Common APIs used by Noice Web applications for gapless audio playback.

How it works?

We use Web Audio APIs to support gapless playback. SinceBaseAudioContext.decodeAudioData()method doesn't allow decoding small chunks of an audio file individually, weserve them from the server side as split segments alongside an index file. Theindex file holds references to all chunks corresponding to an audio file. On theclient side, we read the index file first. We then read and decode individualchunks and precisely queue them to an audio context for playback.

The following is an example of an index file.

0000.mp30001.mp30002.mp3

Browser Support

  • Firefox 107: Sometimes, a slight jitter is audible during playbackwhen one chunk finishes and the next starts.
  • Google Chrome 108: Works flawlessly.
  • Microsoft Edge 107: Works flawlessly.

Gapless Audio Encoding Caveats

Using FFMPEG'ssegment orstream_segmentmuxersto split and encode the audio files causes gaps during playback. Instead, we use-ss and-to flags to encode individual segments of an audio file one by one.

ffmpeg -y -i source.wav -c mp3 -ab 320k -ac 2 -ar 44100 -ss 0 -to 10 0000.mp3

License

GNU GPL v3

White Noise icon by Juraj Sedlák

[8]ページ先頭

©2009-2025 Movatter.jp