waveform

How can I load only waveform and wait to user click 'play' to download the audio on Wavesurfer-js?

会有一股神秘感。 提交于 2020-01-02 01:20:15
问题 On my server I use Audiowaveform to generate JSON data from my audio files. On frontend I use Wavesurfer-JS to draw the waveform based on previous JSON data. The problem is that on page ready the Wavesurfer-JS download on background the audio file all the time (and not only when the user hit the play button). This is my try. This is the salient part: <div id="waveform"> <audio id="song" style="display: none" preload="false" src="http://api.soundcloud.com/tracks/45398925/stream?client_id

Android: Sine Wave Generation

对着背影说爱祢 提交于 2020-01-01 03:01:29
问题 I'm trying to use AudioTrack to generate sine, square, and sawtooth waves. However, the audio this is creating doesn't sound like a pure sine wave, but like it has some kind of other wave overlayed. How would I go about getting the pure sine wave like in the second code example, while using the method in my first example? Since the top example only moves around some of the arithmetic used in the second, shouldn't they produce an identical wave? @Override protected Void doInBackground(Void...

Getting max amplitude for an audio file per second

夙愿已清 提交于 2020-01-01 00:25:07
问题 I know there are some similar questions here, but most of them are concerning generating waveform images , which is not what I want. My goal is to generate a waveform visualization for an audio file, similar to SoundCloud, but not an image. I'd like to have the max amplitude data for each second (or half second) of an audio clip in an array. I could then use this data to create a CSS-based visualization. Ideally I'd like to get an array that has all the amplitude values for each second as a

sine wave that exponentialy changes between frequencies f1 and f2 at given time/amount of samples

你说的曾经没有我的故事 提交于 2019-12-30 06:44:12
问题 I'm trying to implement Python method that generates sine wave, which ramps up between two freq exponentially. Linear change was solved in [this question] with following Python code: from math import pi, sin def sweep(f_start, f_end, interval, n_steps): for i in range(n_steps): delta = i / float(n_steps) t = interval * delta phase = 2 * pi * t * (f_start + (f_end - f_start) * delta / 2) print t, phase * 180 / pi, 3 * sin(phase) sweep(1, 10, 5, 1000) How to change this linear accumulative

Counter Not Testing As Expected? [VHDL]

淺唱寂寞╮ 提交于 2019-12-25 07:51:29
问题 I'm trying to make a 32 bit counter in VHDL. Below is my code: LIBRARY ieee; USE ieee.std_logic_1164.ALL; USE ieee.numeric_std.ALL; ENTITY counter32 IS PORT (en, clk, clr: IN STD_LOGIC; count: OUT STD_LOGIC_VECTOR(4 DOWNTO 0)); END counter32; ARCHITECTURE rtl OF counter32 IS SIGNAL count_result: STD_LOGIC_VECTOR(4 DOWNTO 0); BEGIN counter32: PROCESS(clk, clr) BEGIN count <= "00000"; --Initialize counter to all zeroes IF (clr = '0') THEN count_result <= "00000"; ELSIF (clk = '1' and clk'EVENT)

Generate Sawtooth Tone in Java/Android

ぐ巨炮叔叔 提交于 2019-12-25 01:45:22
问题 I'm just making a tone generator and I was able to find code that makes a sine wave of a specified frequency: private void genTone(){ // fill out the array for (int i = 0; i < numSamples; ++i) { sample[i] = Math.sin(2 * Math.PI * i / (sampleRate/freqOfTone)); } // convert to 16 bit pcm sound array // assumes the sample buffer is normalised. int idx = 0; for (final double dVal : sample) { // scale to maximum amplitude final short val = (short) ((dVal * 32767)); // in 16 bit wav PCM, first byte

ActionScript - Creating Square, Triangle, Sawtooth Waves From Math.sin()?

限于喜欢 提交于 2019-12-24 12:53:00
问题 is there common code available that produces square, triangle, sawtooth or any other custom waveforms using the math class? below is a basic function that handles a SampleDataEvent and plays a middle-c (440 Hz) sine wave. i'd like to change the tone by incorporating square, triangle and other waves. var position:int = 0; var sound:Sound = new Sound(); sound.addEventListener(SampleDataEvent.SAMPLE_DATA, sampleDataHandler); sound.play(); function sampleDataHandler(event:SampleDataEvent):void {

Drawing Waveform with AVAssetReader and with ARC

落花浮王杯 提交于 2019-12-24 00:17:18
问题 I'm trying to apply Unsynchronized's answer (Drawing waveform with AVAssetReader) while using ARC. There were only a few modifications required, mostly release statements. Many thanks for a great answer! I'm using Xcode 4.2 targeting iOS5 device. But I'm getting stuck on one statement at the end while trying to invoke the whole thing. Method shown here: -(void) importMediaItem { MPMediaItem* item = [self mediaItem]; waveFormImage = [[UIImage alloc ] initWithMPMediaItem:item completionBlock:^

Equation for trapezoidal wave equation

空扰寡人 提交于 2019-12-23 12:16:46
问题 I'm writing a c function to generate trapezoidal wave. Does any one know a mathematical equation to generate trapezoidal wave? Very similar idea as y=A*sin(B*x) generates a sin wave for different values of x. 回答1: A way of sending a single pulse of trapezoidal wave includes using the Heaviside Step Function http://en.wikipedia.org/wiki/Heaviside_step_function Use it if you want the "pure" mathematical way of representing this kind of function. Just build your function "piece by piece",

Windows Form Paint equivalent event in WPF

房东的猫 提交于 2019-12-21 21:52:56
问题 I have used the PAINT event to draw a wave on a Panel in Winows Form Application. But when using it WPF, I didn't find any such element equivalent to a Panel which has a Paint Event. Googled a lot too but no great use. Well, I need to draw a waveform in WPF so suggest appropriate solutions wrt PaintArgsEvent or a new solution altogether. Thank You! 回答1: You are looking for the DrawingVisual Class From first Link: The DrawingVisual is a lightweight drawing class that is used to render shapes,