Skip to content

viaacode/audiowaveform

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

audio stream waveform-data generater

audiowaveform generates waveform data from audio streams. The data it generates is equivalent to the waveform data generated by bbc/audiowaveform.

It was written because the former does not generate waveforms 'on the fly' from a http audiostream nor from a pipe/socket.

It supports every format/codec combination with at least one audio channel that ffmpeg can read.

dependencies:

  • ffmpeg: generate a single channel (mono) stream of pcm encoded audio data from the audio source to a pipe.
  • ruby-audio: (based on libsndfile): read pcm data from the pipe

usage:

snd = Sound.new source: 'http://download.blender.org/peach/bigbuckbunny_movies/big_buck_bunny_480p_surround-fix.avi'

snd.channels #=> 1
snd.sample_rate #=> 48000
snd.waveform #=> {:sample_rate=>48000,
    :samples_per_pixel=>2048,
    :bits=>8,
    :length=>13979,
    :data=>[ ..., -7, 9, -8, 10, -9, 10, -8, 10, -10, 9, -12, 11, -19, 16, -18, 18, -26, 21, -32, 22,... ]}

About

generate waveform data from an audio stream

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages