Is it possible to record voice and playback voice with a delay using Flash? - actionscript-3

I've been working on a Flash script that allows the user to speak and playback what the user is saying after certain but exact time, say 10 seconds. That without sending anything to the sever, I've been asking around with no success about it. Is this simply impossible?

Yes this is possible, see here for an example of recording and then playing back the captured audio: http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118a9b90204-7d1d.html#WS184831AF-B842-4d52-BFB9-D7601F4A9E21
The example above basically does exactly what you are looking for.

Related

Chrome- won't seek audio when already preloading

I'm using HTML5 audio. Everything is going swell, our server supports HTTP ranges and the audio streams/buffers correctly, etc.
There's just one slight problem with seeking. When you seek to a new position, Chrome sometimes doesn't seek there when there's an existing request going. It just completely ignores the request to seek, so the user can't actually play back at the new seek position.
How can I make Chrome always stop the existing request and start serving for the new seek result?
Chrome seems to respond to the seeked() event, but I've noticed by logging the events that it's this event which is sometimes not fired promptly. I tried manually firing the seeked() event, but that does not seem to be helping.
I found an answer recommending playing and then pausing for a similar-sounding issue for video elements. Unfortunately I did not find this to have any effect for me.
I've mitigated this issue by reducing the request size. Previously, when the browser requested a range, we pretty much just sent back the range it asked for. Now I cap the size at 100kb. Chrome still rarely interrupts a request to seek; but now even on a slow connection each request is still just a couple of seconds, so it's not tremendously unusable given the connection quality.

Music player that continuously play music even if no one is online

I was wondering if it's possible to have a music player that will always play music even that the user is not on the site.. Kinda like streaming...
I am using jwPlayer but every time I enter the site my playlist starts from the beginning but I want her to keep playing even if I'm not there..
if there is anyway to do that please tell me..
Thanks in advance
You would need to have a virtual state that the server keeps track of. You would not really be streaming if you don't have a target device to stream to... so the server just needs to keep track of everything then continue streaming at the location you expect when the person reconnects to the server by whatever device they are using.

Record videoconference application to flv

I've spent plenty of time solving this problem, but it looks like I need some help. I have a web conference application which provides ability to stream live video, chat, share documents, draw on a whiteboard, share desktop, etc. And now I want to record everything that happens in taken separately so called webinar, including video and sound. So I'm looking for tools that can help with this goal.
Here's input data:
This is Adobe Flash based application
Using wowza server
Everything should be recorded on server
Many webinars can be in recording mode at the same time
Record should be represented in video (flv, mp4 or whatever)
What I've done so far and what I problems I have:
I have implemented recording on server side. But this is not a video, this is just a list of commands to recreate passed webinar. It works, but has lot's of limitations and problems with rewinding.
And now I'm testing this FLV Encoding library. I created AIR application that starts on server when record is needed, connects to taken webinar and takes screenshots from itself with BitmapData.draw() method. Works pretty neat, but has some limitation that I'm looking help with:
First of all, this is sound problem. I have no idea how to catch all
sounds from all sources in flash. So far from my tests and googling I conclude that SoundMixer.computeSpectrum() won't help me to do this. Maybe this can be done on server side by mixing all streams on the right time but I think this can lead to synchronization problems and I prefer to capture sound on client. Maybe there is way to capture audio byte array from rtmp stream somehow?
Security problems. We have 2 kinds of them. First ones are with streaming videos. BitmapData.draw() method throws exeptions even after adding <StreamAudioSampleAccess>true</StreamAudioSampleAccess>
<StreamVideoSampleAccess>true</StreamVideoSampleAccess> on server. There are lots of posts about this problem and no good solution.
But more complex problem is that YouTube videos can be opened in webinar using api player. And in this situation I have no idea how to resolve security problem. Maybe someone knows a way or workaround to use BitmapData.draw() on YouTube AS3 player?
Or maybe there is another good way to solve my recording issue?
Free Apache Openmeetings conferencing [1] has a java recording application inside which should work in 3.0 release. Just use it.
[1] http://openmeetings.apache.org/

In AS3 how can you detect if someone pulls their camera out of the USB port?

In AS3 if the SWF gets a hold of someone's camera successfully and they start streaming video across and everything, but then mid-stream, either they accidentally wiggle their camera out of the USB port, or the camera just sort of breaks down, or something else like that, how could you detect it from that user's side? I've tried using event listeners and also polling different variables every five seconds, but neither has worked; none of the public properties of Camera or its events seem to act funny at all when something like that happens. And apparently you can't just keep scanning the computer for devices (for good reason, I guess).
Is there something I'm missing here? Is there a way to detect from a user's copy of a SWF (FP or AIR, but much more importantly FP) when their camera has effectively stopped as the result of something going wrong, such as them wiggling it out of the computer by mistake? If so how? Thanks!
While you may have difficulty in detecting when the camera/microphone stops working or is deactivated, you can discern that something has gone wrong if you are publishing the video/audio to a server with a NetStream.
The NetStream has an info property which is a NetStreamInfo object. It will give you both a running total of bytes as well as a rate of bytes/second of data that the NetStream is sending to the server.
Running totals: byteCount, audioByteCount, videoByteCount
current rate in bytes/second: currentBytesPerSecond, audioBytesPerSecond, videoBytesPerSecond
If you use the running totals, you need to periodically check the byteCount and calculate your own rate. Or you can let Flash Player do all the work and use the rates that it's calculating. In the case of recording, these values give you an indication of how much data the NetStream is receiving from the camera/microphone (and going to send to the server).
We found that we could reliably determine on the client that something had gone wrong when the rate fell below 5 kilobits/second. We used the same threshold and similar calculations on an FMS server (w/custom server side Actionscript) as well.
I don't recall a proper "get camera status" call you can make on demand but you can try listening for the status event and hope there's one fired on disconnect.
If you haven't already done so, on you 5 second check try: if(myCameraObject == null) assuming var myCameraObject = Camera.GetCamera();
If you can't find a better solution, consider placing a "Detect camera" button behind the camera feed. If the camera disconnects then the user would see the button and could click it to reconnect.
You can check if the camera object is null as suggested by #ToddBFisher, check the Camera.names.length>0 or a few other properties of the camera instance (see the links below). But in each of them you'll want to check it at a regular interval.
Working with Cameras
Monitoring Camera Status

Post-processing captured video in AS3, creating slow motion

I have an interesting project wherein I need to allow users to capture video of themselves with a webcam at a kiosk, after which I email them a link to their video. The trick is the resulting video needs to be a 'slow motion' version of the captured video. So for example, if someone creates a 2 minute movie, the resulting movie will be 4 minutes.
I'd like to build this in Flex / AS3 if possible. I don't have issues capturing the video and storing it / generating and emailing a link, but slowing down the video is the real mind bender. I'm unsure how to approach 'batch post-processing' a set of videos using Adobe tools.
Has anyone had a project similar to this or have suggestions on routes to take in order to do this?
Thanks!
-Josh
This is absolutely feasible from the client side, contrary to what some may believe. :)
http://code.google.com/p/flvrecorder/
Just adjust the capture rate, which shouldn't be too difficult all the source is there.
Alternatively, you could write an AIR app that launches Adobe Media Encoder after writing a file and launch it with a preset that has FTP info etc. Or you can just use the socket class to connect and upload over FTP.
http://code.google.com/p/fl-ftp/
It is not feasible to do this client-side.
Capture the video and send it to the server.
Use a library like FFMpeg to do your coneversions