Using swf as audio from javascript - javascript

I've been working at a startup for some time and nearly have a product ready to ship for a certain platform that's a very high quality html5 javascript game. Everything was made in html5 from using canvas and even the audio+video elements. Now after we sent in our product for review they responded by telling us that the audio wasn't finished yet on their end and to convert our audio to swf and use flash for it instead.
The problem is I'm not a flash developer, I've never touched flash and only worked in javascript and we're already behind schedule. I don't have the slightest clue how I'd go about using swf files to play audio in a non obtrusive manner for an action game. Especially since our game is no simple game with a simple sound track. There's several tracks of audio an opening video, and dozens of sound effects for weapon clashes and such.
Is there anyone that can give me some tips or share some links on how I could go about using swf for audio for lots and lots of sounds without it making a mess of things and the dom?
Thanks alot

This post should help you with calling flash functions from javascript. http://painteddigital.com/2008/calling-flash-as3-functions-from-javascript/ Pretty easy.
Playing audio from flash is very simple too. Just take a look at the documentation for the Sound class.

Related

JWPlayer vs Custom Player

I'm playing around with HTML5 videos and front end work. I'm wondering, why use JWPlayer or any other plugin instead of (extensively) creating your own? Other than it being less work.
Browsers, devices, advertising standards, etc are constantly changing, making it essentially impossible to responsibly keep up with the rapidly moving market AND continue to develop on top of the player (which, if you look at building a player from a macro perspective, is where the work really begins).
In short, using a product like JW Player gives you all of those benefits on top of the <video> tag without requiring you to become an expert in video engineering.

Audio track looping in Javascript without a delay

I'm currently helping a friend develop a web application in which I need ~6 audio tracks (all using the same time signature) to continuously loop and stay in sync. To give context, it is a typeface-music pairing application where as soon as a typeface is chosen, the associated audio loop starts playing and as the user keeps picking typefaces, the tracks layer and begin to resemble a song.
I've tried using SoundJS and the Buzz sound library, but I keep running into the same problem: there is always a slight delay between loops. This would be fine if all my audio tracks were the same length, but they aren't, so very quickly things go out of sync.
This seems to be a known problem, but I can't seem to find any answer to how to fix it. I came across Hivenfour's SeamlessLoop 2.0, but - unless I'm using it completely wrong - it doesn't actually seem to work (setting a volume returns an error).
If anyone has experience with this, I would truly appreciate any input! Thanks :)
SoundJS WebAudioPlugin uses a look ahead approach with web audio that will loop seamlessly, which is described here in a what will probably be a very helpful on audio timing.
Also be aware that some compression formats will insert white noise into sounds. I believe mp3 does this. WAV is supported broadly and does not.
As for HTMLAudioPlugin, we loop as smoothly as the browser will allow but it does not have the same precision as WebAudio.
Hope that helps.

Changing the pitch of a speaking voice with JavaScript and html

I can change the speed of playback of a recording of a speaking voice very easily and effectively by using .playbackRate on an Audio tag . Is there any way to change the pitch of the voice during playback.
I've used pitch-shifter.js from this project for pitch shifting. It seemed to work pretty well. https://github.com/urtzurd/html-audio
However, that script uses the web audio API, which is a fair bit more complicated than just using audio tags.

How to convert a javascript animation to video output on client side

Is there any simple way to create video output of js animation without editing the js at all.
If that is absolutely possible, how I can I edit the js to create images or videos of the animation. This has to be really really fast, since I want to do some real time processing on the animation.
I am using Ubuntu on the desktop.
Thanks in advance
You can use VLC (http://www.videolan.org/vlc/) to capture your desktop into a movie file.
VLC allows you to apply filters o you may stream the video to postprocessing software.
Really fast and Javascript .... don't really go well together. Depending on the quality of animation you want, it is anywhere from slow to "Egads, we need a thousand machines to render this 5 minute scene"
You'd have to render a imagine, save the image, then render the next.
You'd be far better off using a system, platform and software suited for the job.

Adjust playback speed of videos in a browser

There is a program at enounce.com that it will increase the play speed of a video in a browser. I think that 95% of videos on the internet run on flash therefore this tool can be useful. I am wondering how that program was created. Maybe they modify the html source in the browser? perhaps it looks for the swf video playing on your browser and it injects some JavaScript on that html element to increase the speed. I been researching on Google and I think it is possible to alter the playback speed of a video with JavaScript. If it is not modifying the html page then it will be nice to at least know how this can be achieved. Also if a video plays on your browser it has to be saved somewhere in your computer I believe. That's why you can seek back and forth once the video finished downloading. why is it that it is almost impossible to find it and the only way of getting that video will be by capturing the packages with a package sniffer? anyways that is not my question I am just really curious on how that program achieves doing what it does. it speeds up everything even Pandora songs.
MySpeed seems to intercept the media stream coming from the server into the Flash player that sits in your browser. It changes the speed on the fly, and sends the result to the Flash player.
PS: If you need to control the playing speed of your own videos I recommend looking into the VLC Browser Plug-in, or the QuickTime player, which also has very good speed control features (from Javascript). Or you could use the HTML5 <video> tag.
Afaik, Flash-based players like Longtail/JWPlayer and Nonverbla don't have very good support for this.

Categories