Menu
  • HOME
  • TAGS

What is the structure of this JavaScript expression and why does it evaluate to 'true'? (HTML5 audio tag and canPlayType() function)

javascript,html5,audio

You might be confused because you see both the assignment operator = and the comparison operator != (not equals). These are not the same. Essentially it is saying: if (audio.canPlayType('audio/mpeg') == "") mp3Support = false; else mp3Support = true; Which can be reduced to: mp3Support = !(audio.canPlayType('audio/mpeg') == "") And...

video to audio file convert & save through FFMPEG in node js

javascript,node.js,audio,video,ffmpeg

I would do it like: var ffmpeg = require('fluent-ffmpeg'); /** * input - string, path of input file * output - string, path of output file * callback - function, node-style callback fn (error, result) */ function convert(input, output, callback) { ffmpeg(input) .output(output) .on('end', function() { console.log('conversion ended'); callback(null); }).on('error',...

Windows - sound recording program giving noise

windows,audio,wav

One obvious problem is that you're mixing the usage of 16 and 8 bits. You're buffer is defined as a 16-bit short. Notice your own comment: short int waveIn[NUMPTS]; // 'short int' is a 16-bit type; I request 16-bit samples below // for 8-bit capture, you'd use 'unsigned char' or...

Unity 5 Audio Volume Slider (Solved)

c#,audio,unity3d

The master volume control in Unity is owned by the AudioListener Your code is updating a saved value in PlayerPrefs called VolumeLevel, but it doesn't actually tell Unity to change the volume at any point. To do that globally (i.e. for all sounds at once), you can update AudioListener.volume with...

How do I Mute The Audio In Unity 3D?

c#,audio,unity3d,mute

Simply google it, the following is from: http://answers.unity3d.com/questions/52109/how-do-i-mute-all-audio-sound.html AudioListener.pause = true; AudioListener.volume = 0; try this http://unity3d.com/support/documentation/ScriptReference/AudioListener-pause.html...

How to retrieve data from NSUserDefaults?

ios,swift,audio,nsuserdefaults,mpmediaitemcollection

Here is the issue var currentQueue: MPMediaItemCollection = MPMediaItemCollection() You must init with items As per the documentation by apple. init(items:) Designated Initializer Initializes a media item collection with an array of media items. Declaration Swift init!(items items: [AnyObject]!) Parameters items The array of items you are assigning to the...

C# NAudio makes Noise WAV file without errors after POST from another page

c#,audio,wav,naudio

The most likely explanation for the file playing back slowly is that you've got the wrong wave format. Number of channels and sample rate being the most likely explanation. So where you have new WaveFormat(44100, 16, 1), how do you know that is the correct format? I'd suggest trying with...

How to convert base64 string into an audio mp3 file?

php,audio,base64,mp3

If the base64 encoded data already represents an MP3 file, it should be as easy as decoding the base64 data and storing it in a file: file_put_contents('audio.mp3', base64_decode($data)); ...

Unity3d AudioSource not creatable

c#,audio,unity3d

This is perfectly natural C#, but it won't fly: sct=new AudioSource(); Unity has a component-driven, factory-based architecture. Instead of calling a component constructor, Unity wants you to call AddComponent to attach the component to a specific GameObject: sct = gameObject.AddComponent<AudioSource>(); There are a few reasons for that. First off, Unity...

iOS Swift: Sound not playing on iPhone Simulator

ios,iphone,swift,audio,ios-simulator

You just need to move the declaration of your audioPlayer out of your method. Try like this: var audioPlayer:AVAudioPlayer! func playSound() { if let soundURL = NSBundle.mainBundle().URLForResource("doorbell", withExtension: "mp3") { audioPlayer = AVAudioPlayer(contentsOfURL: soundURL, error: nil) audioPlayer.prepareToPlay() audioPlayer.play() } } ...

What's the reason of using Circular Buffer in iOS Audio Calling APP?

ios,objective-c,audio,core-audio,audiounit

Good question. There is another good reason for using Circular Buffer. In iOS, if you use callbacks(Audio unit) for recording and playing audio(In-fact you need to use it if you want to create a real-time audio transferring app) then you will get a chunk of data for a specific amount...

How to force all sounds to shut down

java,android,audio

First please remove new MainActivity :) If you would like to start a new Activity, use Intents. http://developer.android.com/training/basics/firstapp/starting-activity.html Second, I would create a separated service (started from a new thead) which is responsible for music player. You can communicate with this Service (NOT IntentService) with Broadcast or with Bind-ing it....

Stereo to Mono wav in Python

python,audio,signal-processing

First, what is the datatype of audiodata? I assume it's some fixed-width integer format and you therefore get overflow. If you convert it to a floating point format before processing, it will work fine: audiodata = audiodata.astype(float) Second, don't write your Python code element by element; vectorize it: d =...

ios media picker shows only white screen/stuck

ios,iphone,swift,audio,mpmediapickercontroller

MPMediaPickerController is a UIViewController. So don't show it in screen with currentViewController.view.addSubview(picker.view). When you show it with presentViewController(picker, animated: true, completion: nil), it's the correct way. In the delegate methods, when you were calling mediaPicker.dismissViewControllerAnimated(true, completion: nil), you still had mediaPicker.view as a subview of currentViewController.view....

“Converting” in jQuery an audio player with multiple tracks

javascript,jquery,audio

You can use a common listener like this: $('ol').on('click', 'li img', playAudio); var currentlyPlaying; function playAudio(e){ var audElement = $(e.target).siblings('audio')[0]; window.aa = audElement; if(audElement && audElement.paused){ if(currentlyPlaying) currentlyPlaying.pause(); currentlyPlaying = audElement; addListeners(currentlyPlaying); currentlyPlaying.play(); }else if(audElement){ audElement.pause(); } } function addListeners(aud){ aud.removeEventListener('ended', onPause); // remove done to remove previous listener...

Cordova media plugin and local files in Windows Phone 8

cordova,audio,windows-phone-8,media

var mypath = location.pathname; var idx = mypath.lastIndexOf('/'); var backgroundMusicFilePath = mypath.substring(0, idx + 1) + "audio/BackgroundMusic.mp3"; app.backgroundMusic = new Media(backgroundMusicFilePath); The local mp3 for my project is stored under the www\audio folder. Getting the local file is tricky because it differs for iOS, Android and WP8....

iOS Safari play sounds in sequence after one touch

javascript,ios,audio,safari,playlist

Your best solution here is to use the Web Audio API instead of Audio objects. Web Audio API is widely available and even works in iOS 6. This will allow you to have one constant AudioContext that you can layer sounds on, even playing multiple simultaneously if you wish. One...

Linux ALSA Driver using channel count 3

linux,ubuntu,audio,alsa

A period (and the entire buffer) must contain an integral number of frames, i.e., you cannot have partial frames. With three channels, one frame has six bytes. The fixed period size (4096) is not divisible by six without remainder....

How to encode and decode audio using opus

ios,audio,codec,opus

I found what the problem is. I have set the audio format is float kAudioFormatFlagIsPacked|kAudioFormatFlagIsFloat;. I should use opus_encode_float and opus_decode_float instead of opus_encode opus_decode. As @Ralph says, we should use fec = 0 in opus_decode. Thanks to @Ralph.

How to Play Audio in Background Swift?

ios,swift,audio,avfoundation

You need to set your app Capabilities Background Modes (Audio and AirPlay) and set your AVAudioSession category to AVAudioSessionCategoryPlayback and set it active var categoryError: NSError? if AVAudioSession.sharedInstance().setCategory(AVAudioSessionCategoryPlayback, error: &categoryError) { println("AVAudioSession Category Playback OK") var activateError: NSError? if AVAudioSession.sharedInstance().setActive(true, error: &activateError) { println("AVAudioSession is Active") } else if let...

How do i play a sound in python 3?

python,audio,pygame

Add python to windows 7 PATH Hold Win and press Pause. Click Advanced System Settings. Click Environment Variables. In "User variables" Click "New" if there is no PATH, else select PATH variable and click "Edit" Append ;C:\python34 to the Path variable. Restart Command Prompt. Installing pygame You first want to...

Sound go back with Swift

swift,audio

You can use the Swift ternary conditional operator '?' You check if currentTime > 30 ? If true subtract 30 : otherwise equal 0 sound1.currentTime = sound1.currentTime > 30.0 ? sound1.currentTime - 30.0 : 0 Edit As pointed by the OP just simply subtract 30s from the currentTime because it...

AVAudioPlayer not playing long sounds?

ios,audio,avaudioplayer

Quick summary of the comments: Turns out the sleep(n) was needed since the entire class containing the AVAudioPlayer was deallocated. Retaining the class fixes the issue. Cheers!...

How to completely load audio but play it later?

java,audio,javasound

You can store it in a Java Clip. Example: Clip clip = AudioSystem.getClip(); clip.open(/*your AudioInputStream*/); Make clip a field, to use it later....

When reading a WAV file, dataID is printed as “fact” and not “data”

audio,wav

The RIFF specification doesn't require the 'data' chunk to follow the 'fmt' chunk. You may see some files that write a 'pad' chunk after the 'fmt' chunk to ensure page alignment for better streaming. http://en.wikipedia.org/wiki/WAV Also the format code indicates the audio compression type, as you noted. Valid format codes...

Javascript play multiple audio in loop

javascript,audio,while-loop

the mistake you are making, you are not waiting for ended event of the audio before starting the next one, also I am assuming that you are not showing the controls for the audio elements, then you can simplify it as a single audio element and do something like: Number:...

How do I calculate logrithmic labels for a VU meter scale?

javascript,html5,audio,canvas,html5-canvas

I suppose you have a value-to pixel function. What you need to write is the inverse function of that. When you have the inverse function, you just divide the screen area to N equal parts (in the picture you have 6 regions). One region will be X pixels in width....

Audio on scroll

javascript,jquery,css,audio,skrollr

var playing = false; var audioElm = $('#soundTour').get(0); $(window).scroll(function() { var pageScroll = $(window).scrollTop(); if(!playing && pageScroll > 500 && pageScroll < 3000){ audioElm.play(); playing = true; }else if(pageScroll > 3000 || pageScroll < 500){ audioElm.pause(); playing = false; } }); You need to ad some conditions. (I define the...

Audio Jump Forward Button

swift,audio

You have misread the docs. playAtTime: does not seek to a later time in a sound file. It delays the start of playing the sound file (from the start). To play from the middle of a sound file, set the player's currentTime and start playing....

Custom audio player issues

javascript,css,html5,audio

jsBin demo Don't use inline JS in your HTML! Makes code hard to debug. Keep your logic away from your presentation/template. To start from, how variables work? Once you set a var, there's no need to instantiate the same var again using var inside your code. Simply use/modify it. So...

My sounds are not playing in Chrome

javascript,html5,google-chrome,audio

Turn on logging in Chrome (inspect element/console - Preserve log) and see what your code is doing. Also, you could try enabling/disabling your audio flags just be sure to set them back to default when you are done. chrome://flags/#disable-encrypted-media chrome://flags/#disable-prefixed-encrypted-media/ chrome://flags/#try-supported-channel-layouts chrome://flags/#enable-delay-agnostic-aec chrome://flags/#disable-delay-agnostic-aec chrome://flags/#enable-tab-audio-muting in chrome and see if that...

play audio periodically from a memory stream c#

c#,audio,windows-phone-8.1,memorystream

Here how I did it - just create a new SoundEffectInstance object and set it to the return value of SoundEffect.CreateInstance. https://msdn.microsoft.com/en-us/library/dd940203.aspx SoundEffect mySoundPlay = new SoundEffect(mStrm.ToArray(), 16000,AudioChannels.Mono); SoundEffectInstance instance = mySoundPlay.CreateInstance(); instance.IsLooped = true; instance.Play(); ...

onended audio event firing without playing the audio

javascript,html5,audio,javascript-events

I've got it to work. <!DOCTYPE html> <html> <body> <script> var count=0; </script> <p>Press play and wait for the audio to end.</p> <audio id="myAudio" onended='IncrementCount()' controls> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3" type="audio/mpeg"> Your browser does not support the audio element. </audio> <audio id="myAudio2" controls onended='IncrementCount()'> <source src="horse.ogg" type="audio/ogg"> <source src="horse.mp3"...

Background Music in Adobe Flash keeps duplicating?

actionscript-3,flash,audio

This happens because everytime you navigate back to Frame 1, the code is activated once again. To avoid playing it again, I suggest to have a variable of Number or Boolean type named "musicPlaying" and modify your code this way: var channel: SoundChannel; if (!musicPlaying) { var bmsound: Sound =...

Play Audio from other apps

ios,audio,mpmusicplayercontroller

I needed to play and record audio at the same time and had trouble with the stopping of background music. I was able to do so with this audio setup: AVAudioSession *audioSession = [AVAudioSession sharedInstance]; [audioSession setActive: NO error: nil]; [audioSession setCategory:AVAudioSessionCategoryPlayAndRecord withOptions: AVAudioSessionCategoryOptionMixWithOthers error:nil]; [audioSession setActive:YES error:nil]; Here is...

Corona sdk : stop audio when another starts / launch audio just once

audio,corona

Play every audio with reference id value : if (event.object1.myName == "obst3") then local isChannel1Playing = audio.isChannelPlaying( 2 ) if isChannel1Playing then audio.stop( playLaserSound2 ) playLaserSound2 = nil end playLaserSound1 = audio.play(colsound, { channel=1 }) end if (event.object1.myName == "t") then local isChannel1Playing = audio.isChannelPlaying( 1 ) if isChannel1Playing then...

Audio player - sharing data between callbacks

matlab,audio,callback

I'm not shure whether the following works: hObject.UserData = player; I would (as you have already found out) use a global variable. I didn't test this solution, but it should work and shows how to use global variables in combination with a GUI correct. Please correct me if you found...

Using rangeslider.js for an HTML5 audio time scrubber

javascript,jquery,html5,audio,slider

I've made a working demo here: http://jsfiddle.net/alan0xd7/79ff562k/ This uses the timeupdate event to update the range slider. However there are some quirks when you try to change the time while it is playing - sometimes it snaps back to where it was. I believe this is some sort of race...

After Effects scripting - convert audio to keyframes?

javascript,audio,after-effects

Answer provided by: Walter Soyka app.executeCommand(app.findMenuCommandId("Convert Audio to Keyframes")); ...

How to control red noise generator by another one (Rocket engine effect - Subtractive synthesis of sound)

java,audio,signals,signal-processing,wav

I have already solved this problem: I have a white noise generated as an array of doubles: public static double[] whiteNoise(int length) { double[] out = new double[length]; for (int i = 0; i < length; i++) { out[i] = (Math.random() * 2 - 1.0)/2.0; } return out; } I...

Android How To Find Decibels

android,audio,microphone,decibel

getMaxAmplitude returns a number between 0 and 32767. To convert that to dB you need to first scale it to to a value between 0 and -1. 20*log10(1)==0 and 20*log10(0)==-inf. If you're getting -inf then this can only be because you're passing 0 to the log function. This is most...

Automatic slider in Pure Data?

audio,puredata

If your question would simply be: How do I automate a slider? The answer would be to look at the [line] object. Line interpolates from a current value to a target value in a given time. (Note: When controlling signals, we use [line~] instead.) However, your goal is the simulation...

Convert mp3 to WAVE in java without external libraries

java,audio,javasound

If you want to tell java "hey, convert an mp3 file", it won't do that, because it isn't made for mp3. If, however, you are comfortable with using a purely java library, then check out JLayer. I have used it myself and it worked wonderfully.

Playing audio for given amount of time in Android

java,android,audio,media-player

Try like this: mp.start(); Handler handler=new Handler(); handler.postDelayed(new Runnable() { @Override public void run() { mp.stop(); } }, 20 * 1000); After 20 seconds, the audio will be stopped....

Stream.CopyTo(newStream) return Length 0

audio,windows-phone-8.1,memorystream

I got the solution for the problem: do the following before calling CopyTo() mStrmStartDelimiter.Position = 0; mStrmEndDelimiter.Position = 0; ...

mediaelement.js - How to change width

javascript,audio,media-player,mediaelement.js,mediaelement

you can find the option at the API list // if the <video width> is not specified, this is the default defaultVideoWidth: 480, // if the <video height> is not specified, this is the default defaultVideoHeight: 270, // if set, overrides <video width> videoWidth: -1, // if set, overrides <video...

Raw numpy array from real-time network audio stream in Python

python,audio,numpy,ffmpeg,pyaudio

Ok, figured it out. Apparently, this can be done without using any external libraries, just relying on urllib and wave. Here is a code snippet that streams data, converts it to a numpy array (for instance for processing) and then back in order to save it to a file. Tested...

Shoutcast + Web Audio API CORS issue

javascript,ajax,audio,shoutcast

Just to answer my own question. I was able to get this working fine with the shoutcast stream by setting up a reverse proxy in apache that pointed to my shoutcast stream and port.

Unity3D Play sound from particle

audio,unity3d,collision,particles

You can use OnParticleCollision and the ParticlePhysicsExtensions, and play a sound with PlayClipAtPoint: using UnityEngine; using System.Collections; [RequireComponent(typeof(ParticleSystem))] public class CollidingParticles : MonoBehaviour { public AudioClip collisionSFX; ParticleSystem partSystem; ParticleCollisionEvent[] collisionEvents; void Awake () { partSystem = GetComponent<ParticleSystem>(); collisionEvents = new ParticleCollisionEvent[16]; } void OnParticleCollision (GameObject other) { int safeLength...

How to repeat captcha letters

javascript,audio,captcha,repeat

What likely causes your script to crash: setTimeout(play(), 1000); This statement immediately calls play(), which immediately calls play again, etc., infinitely. The proper way to call setTimeout is: setTimeout(play, 1000); This will call play in 1000 ms, which is the expected behavior. Other than this, you can drastically reduce your...

Cant get value from struct wrapped in NSValue

ios,objective-c,audio,struct,singleton

The problem (as I'm sure you know) is these lines: AudioStreamBasicDescription desc; asbd=[value getValue:desc]; That is not how you call getValue:. There are two things wrong: You need to supply (where you are saying desc) the address of a buffer, not (as you are doing) the name of an uninitialized...

Processor Audio JavaScript HTML5

javascript,jquery,events,audio

You can use local variables, you just need an identifier to find the audio element later. You also need to append the audio element to the DOM. Also, you have to use pause() not stop(). <script> function start(id, source) { var aud = document.getElementById(id); if (aud) { aud.parentNode.removeChild(aud); } var...

Adding music to my sound board project

java,audio

There are a lot of different ways to play a sound but for example you could do something like this: public static void playSound(File soundfile) throws LineUnavailableException, UnsupportedAudioFileException, IOException{ AudioInputStream audioInputStream = null; audioInputStream = AudioSystem.getAudioInputStream(soundfile); Clip clip = AudioSystem.getClip(); clip.open(audioInputStream); clip.start(); } This code will play wav files without...

Corona sdk : Play sound when main object hits an obstacle

audio,corona,playsound

because you seem so new to Corona I try to you just give you some advise and guides: first of all you should know how to detect collisions: Physics Body after that you should know how to handle Collision Events: Collision and Collision Detection and then you should know how...

Determine amplitude of low frequency signals using FFT

c#,audio,signal-processing,fft

I ended up using this example which works really well. I wrapped it a bit nicer and ended up with: /// <summary> /// Returns a low-pass filter of the data /// </summary> /// <param name="data">Data to filter</param> /// <param name="cutoff_freq">The frequency below which data will be preserved</param> private float[] lowPassFilter(ref...

Trim audio file and get the part between silence

linux,audio,terminal,speech,sox

I believe that what you are looking for can be achieved with a sox silence command. It allows you to remove the silence from any part of the audio given a threshold, durations above it, etc. For a detailed manual please refer to the sox webpage, the silence section is...

FFmpeg audio crossfade

linux,audio,ffmpeg,cross-fade

Finally solved the issue by appending silent space to the beginning of each audio following first one. This will mix the audio one after the other. [0:a]afade=t=out:st=15:d=2[a0]; [1:a]afade=t=in:st=0:d=2[a1]; aevalsrc=0:d=15[s1]; [s1][a1]concat=n=2:v=0:a=1[ac1]; [a0][ac1]amix[a] ...

VoIP limiting the number of frames in rendercallback

ios,objective-c,audio,core-audio,audiounit

You can (and should) use kAudioUnitProperty_MaximumFramesPerSlice to specify the maximum number of samples per frame, not the preferred number; please refer to Apple's Technical Q&A QA1533 and QA1606. To set the preferred number of samples per frame, use the setPreferredIOBufferDuration:error: method of AVAudioSession. For example, if the sample rate is...

Audio through built-in speakers when earphones are plugged in headphone jack in Android

android,audio,soundpool,android-audiomanager,headphones

Alternatively, if you initialize your SoundPool to STREAM_VOICE_CALL, as: SoundPool spool = new SoundPool(1,AudioManager.STREAM_VOICE_CALL, 0) then also your audio should be routed to loudspeaker with any of the way you have mentioned above. I tried and its working on phones even without default FM....

Firefox OS - save file in the app directory

javascript,audio,io,firefox-os,howler.js

Any file that is packaged in the app can be accessed using a relative url. Which means you don't have to get a blob or anything. It won't be possible to save assets (at runtime) in the app folder as far as I can tell. The only way to...

Audio will not play on Android using phonegap, but works fine on iOS

android,html5,cordova,audio,phonegap-plugins

I finally managed to get it working!! I first initialising the audio file by finding the full Android path using @Sarim Sidd help above and then preloading the audio file: //INITIALISE SOUND if(device.platform === "Android") //DIFFERENT PATH FOR ANDROID { //navigator.notification.beep(1); var path = window.location.pathname; path = path.substr( path, path.length...

Toggle VideoView's audio with a Button

java,android,audio

Do you mean: The first time I hold the button, the video should play. While I'm holding the button the audio must be heard. When I release the button, the audio must be muted. When I press and hold the button again, the audio must be heard again. Then what...

Cloning audio source without having to download it again

javascript,html5,audio

With the webAudioAPI you could do something like that : Download once the file via XMLHttpRequest. Append the response to a buffer Create a new bufferSource and play it on each call Fallback to your first implementation if webAudioAPI is not supported (IE) window.AudioContext = window.AudioContext||window.webkitAudioContext; if(!window.AudioContext) yourFirstImplementation(); else{ var...

Concatenate two audio files in Swift and play them

swift,audio,concatenation,avaudioplayer,wav

I got your code working by changing two things: the preset name: from AVAssetExportPresetPassthrough to AVAssetExportPresetAppleM4A the output file type: from AVFileTypeWAVE to AVFileTypeAppleM4A Modify your assetExport declaration like this: var assetExport = AVAssetExportSession(asset: composition, presetName: AVAssetExportPresetAppleM4A) assetExport.outputFileType = AVFileTypeAppleM4A then it will properly merge the files. It looks like...

How do I progammatically play the Android NFC notification sound?

android,audio,nfc

You can get these sounds from the sources of the AOSP project and include them in your own app. The sounds are part of the NFC system service app: https://android.googlesource.com/platform/packages/apps/Nfc/+/master/res/raw/ Btw. starting with Android 4.4, you can disable the sounds while your activity is in the foreground by using the...

Instantiating a SoundFile object within a class in Processing

audio,processing

The error is happening because, like you said, you need access to the PApplet instance that is automatically created for you in your Processing sketch. When you're in another class, the this keyword refers to the instance of that class, not the sketch's PApplet instance. If your class is inside...

RawSourceWaveStream volume control and playback time estimation with Naudio

audio,volume,naudio

1) yes you can use WaveOut.Volume. Another option is to use something like VolumeSampleProvider to do the volume in our signal chain rather than on the device 2) No need to rewrite it - call the .ToSampleProvider() extension method and then pass it through a VolumeSampleProvider 3) The Position on...

Alert once an activity is detected

matlab,audio,alert

You can use beep as a quick solution. If you have a particular sound file you'd like to use, you can use wavread to load the file into Matlab and soundsc to play it.

How to reproduce audio from a stream source

c#,windows,audio,windows-phone

What you’re doing is impossible. Wave files aren’t media streams. You can’t dynamically change a .wav file and expect the MediaElement to pick those changes. If you’re trying to play audio that you’re receiving from the network, or audio that you're generating dynamically from something else, then you need to...

fftw of 16bit Audio :: peak appearing wrong at 2f

c++,audio,fft,fftw,portaudio

You need to implement two different methods of converting. One for int32 to float and another from int16 to float. As currently implemented it is using the int32 conversion in the int16 case. One problem with this is that the scaling factor for conversion to float is wrong. The other...

Searching an arrayList generated by an audio recognition

java,android,audio,arraylist

You don't break from the loop when you find a match, so unless the match is in the last String of the list, the text view will contain Stop at the end. You might want to change it to : boolean match = false; for (String string : results) {...

How do I implement audio controls on this audio visualizer that uses HTML5 Web Audio API?

javascript,php,html5,audio,web-audio

Look at the _visualize method on line 125 of the source. In the method the audioBufferSourceNode holds the file that has been loaded. on line 136 the start() and stop() methods are being used on the audio node. If you get a reference to the audioBufferSourceNode out of the library...

BufferedWaveProvider doesnt work in Unity

c#,audio,unity3d,naudio

Try using WaveOutEvent instead of WaveOut, it worked at least for me in one of the projects. As Mark pointed out: it works because WaveOut uses Windows message callbacks by default, so if you have no gui thread (e.g. you are in a console app), then it can't be used...

Invalid 'n' argument error in readBin() when trying to load a large (4GB+ audio file)

r,audio,runtime-error,analysis,tuner

Wave files are limited to 4GB of audio data because all of the size fields in a wave header are 32-bits. See http://en.wikipedia.org/wiki/WAV#Limitations It's possible that WavePad uses the W64 format mentioned in the Wikipedia article but that readWave does not....

ios - How to play MPMediaItemCollection?

ios,iphone,swift,audio,mpmusicplayercontroller

This code creates three separate music player controllers. Make one and store it in a variable, then send the messages to it MPMusicPlayerController().setQueueWithItemCollection((decodedPlaylistData[indexPath.row] as? MPMediaItemCollection)!) MPMusicPlayerController().nowPlayingItem = (decodedPlaylistData[indexPath.row] as? MPMediaItemCollection)!.items[0] as! MPMediaItem MPMusicPlayerController().play() ...

With NAudio howto capture an signal played

.net,audio,naudio

With NAudio, you can use WasapiLoopbackCapture to capture the soundcard output. Unfortunately, there is no way to specifically capture the audio from another application though.

Python Ripping CD Files to WAV

python,audio,wav,cd-rom

You might want to have a look at PyMedia PyMedia is a Python module for wav, mp3, ogg, avi, divx, dvd, cdda etc files manipulations. It allows you to parse, demutiplex, multiplex, decode and encode all supported formats. It can be compiled for Windows, Linux and cygwin. PyMedia was built...

AVPlayer (or AVAudioSession?) plays after I leave the ViewController, and when I return two are then playing

ios,objective-c,audio,avplayer,avaudiosession

I would create a singleton object to control a AVPlayer, so no matter how many view controllers you have they all would communicate with this one player controller. So basically I'd advise you to move all the code you have in viewDidLoad to some MYPlayerController singleton class.

Playing a .wav file in c# using SoundPlayer

c#,audio,soundplayer

Changing the extension of a file does not change the content in it. M4A are MPEG-4 audio-only data, whereas WAV files are typically raw and uncompressed audio samples. To convert the data itself, you'll need to use an audio transcoding tool like SoX or GoldWave. As for your path specifier,...

HTML Audio embed not working on Internet Explorer

html5,audio

The code that you have for the audio is invalid. If you check the HTML5 definition for the audio tag, the closing tag is mandatory. It works on Chrome and Firefox, but not on IE because of the way in which each browser interprets the invalid code: <audio controls> <audio...

Get 403 (Forbidden) for audio tag

javascript,ajax,audio,html5-audio

If get 403 error in index-content.php request, then it is because you do not set the correct permissions for this file. Set 777 (only a example) for index-content.php, eg.: Go to your project folder cd /etc/var/www/project Set needed permission chmod 777 -R index-content.php Check the setup of your server or...

Merge 2 video files with thier audio in a single file side by side

audio,video,ffmpeg,mux

You need to add the amerge audio filter to combine both audio streams into one: ffmpeg -i input0.mp4 -i input1.mp4 -filter_complex \ "[0:v]scale=iw/2:-1,pad=iw*2,setpts=PTS-STARTPTS[left]; \ [1:v]scale=iw/2:-1,setpts=PTS-STARTPTS[right]; \ [left][right​]overlay=w[v]; \ [0:a][1:a]amerge=inputs=2[a]" \ -map "[v]" -map "[a]" output This will make a stereo output with the audio from input0.mp4 in the left channel,...

Implementing VOIP over udp, what is the approach to take when the player cannot cope up with received packet's speed

android,audio,udp,voip,rtp

Since AudioTrack.write is blocking, you should make sure you have one thread for every channel you are writing to, so that write calls don't get stuck waiting for other channels to complete.

AVAudioPlayer wont play sound when called in other swift file

ios,swift,audio,avaudioplayer

You just have move the declaration of your tmp AVAudioPlayer out of your method. Declare it as class variable. You should also use URLForResource instead of pathForResource: let seaGullSoundURL = NSBundle.mainBundle().URLForResource("Gulls", withExtension: "mp3")! Try like this: import UIKit import AVFoundation class HighScore: UIViewController { var audioPlayer = AVAudioPlayer() override func...

Web Audio- streaming file from server to client

javascript,audio,types,web-audio

I think the issue here is that you're accessing file.length, while file is a Stream object which I don't think have a length property. So what you're doing is basically saying new Int16Array(undefined); and hence the type error. fs.createReadStream is documented here; https://nodejs.org/api/fs.html#fs_fs_createreadstream_path_options You can use the Stream object to...

Audio not working in Javascript

javascript,html,audio

Here is a working audio code... I just moved the function declaration on top of the Start button. Please try it in your end if it works. <script> function startFlash(){ var img = document.getElementById('blink'); var i=Math.floor(Math.random()*(3))+1 var count=0 var q= Math.floor(Math.random() +.5) document.getElementById('beep').play();//no sound if(q==0) { var interval = window.setInterval(function...

How do I look through a javascript array of audio files?

javascript,arrays,audio,for-loop,playlist

You need to use the ended event var audio = new Audio(), i = 0; var playlist = new Array('http://www.w3schools.com/htmL/horse.mp3', 'http://demos.w3avenue.com/html5-unleashed-tips-tricks-and-techniques/demo-audio.mp3'); audio.addEventListener('ended', function () { i = ++i < playlist.length ? i : 0; console.log(i) audio.src = playlist[i]; audio.play(); }, true); audio.volume = 0.3; audio.loop = false; audio.src = playlist[0];...

Tried multiple solutions onsite, none worked: Play on Konami code

javascript,jquery,html5,audio,interactive

According to the docs, you can do it like this: konami = new Konami(); konami.code = function(){ document.getElementById('audio').play(); }; konami.load(); Fiddle Demo Note: not sure if this is how konami sequence must be, but the working sequence is up, up, down, down, left, right, left, right, b, a, enter...

How can I get my iPhone to listen for sound frequencies above a certain threshold?

ios,objective-c,iphone,audio

The fact that I wrote that code helps me answering this question but the answer probably only applies to this code. You can easily limit the frequencies you listen to just by trimming that output array to a piece that contains only the range you need. In details: To be...

VHDL audio sample volume control

audio,vhdl

So i find out what was my problem.. I was shifting sample vector right, but I just made it by "0" & sample(15 downto 1) but it was signed, so I had to copy MSB instead of adding just plain "0".. so answer is sample(15) & sample(15 downto 1) this...

Javascript alert box blocks sound object

javascript,audio,alert

The canplay event occurs when the browser can start playing the specified audio/video (when it has buffered enough to begin). So try this: var audio = new Audio('song.mp3'); audio.oncanplay = function() { audio.play(); alert("1"); }; ...

How to join two wav files together not one after the other

audio

The WAV file format is a chunked layout, typically with a header at the front specifying the format, then a data chunk with the audio data. This is why you can't simply cat the 2 files together. If this something you only need to do once, you can download a...

Working with MIDI in Windows Store App (Win 8.1)

c#,audio,windows-store-apps,midi

I managed to make it work. I've changed the platfrom to x64, and now it works (I used to build it for x86). There is still a problem though (and it is even bigger): I want to integrate this with Unity3d, but Unity3d doesn't allow to build x64 windows apps,...