Output sound to headphones and speakers - actionscript-3

Im wondering if it is possible to output sound to both headphones and built in speakers at the same time. Iv searched but all i can find is references to possible attemps using android. but my application will be web based, using flash and AS3. Can anyone confirm if this is possible or not?
essentially im trying to make a set of DJ decks, and thus need to be able to listen to 2 sounds separately but at the same time (to beatmatch)
Many Thanks
Andy

No, not without a very specific setup. Flash will only output one, globally mixed audio stream from the application. You cannot separate your sounds to be routed to separate outputs.
However, if you're not looking for a general setup but rather a one-off thing where you are able to control the machine it is supposed to be running on - there could be a way. If you are writing an Adobe AIR app, you could write two separate apps:
App A controls the UI and all the sound
App B just receives a sound stream from the first app and plays it
App A then routes the "headphone track" to App B and plays the "main track" as normal.
You could then (maybe) use an application such as Soundflower to route the sound from App A and App B to separate outputs (where one could be the headphones and the other would go to some speakers.)
This all is very dependent on your sound card. You'll most likely need an external sound card to handle the two separate audio streams.

Related

Getting data from Flash that playing online

It somehow should be possible to get all data from Flash File that running currently in browser.
Get all data from rendered objects like values, positions and ect. The more inforamation the better
So what I think is if my computer my adobe flash render all this locally so I'm receiving already it to my computer so I need to read as adobe flash render this.
Look at how Scout works (some info here)
It opens a TCP/IP telemetry channel from which it receives all informations about the movie playing.
I suppose the data would be pretty hard to figure out, plus the movie would have to have the telemetry feature enabled ... but it's a start

Recording output volume from machine using flash

I successfully created an application where i can record microphone sound using flash and then save that stream to a server called "Red5" .
But lately i came across a strange requirement of capturing the output volume from machine and then saving that stream to red5 server.Like if i listen to a song or a skype call or listening to any other sound.I just want to capture those sounds.
I searched for this sort of situation just to get an headstart but i havent found any solution so that i can proceed with it.
Can anyone here provide a start up solution for this.
Can this be done through flash?Or any other way ?
Any help will be appreciated.Please provide suggestions
Thanks
Certainly there are ways to get this done, however using Flash as is I don't see it being possible (most likely a security concern, don't want ads arbitrarily recording peoples conversations).
Programs like Audacity are capable of recording off of the StereoMix output of a computer which is essentially what you're asking about. You could potentially build an AIR app that includes an ANE that packages the functionality from Audacity, but would require quite a bit of porting and... well time.

Creating a server to arbitrate a simple game

I've created a simple game where 2 players make a simultaneous choice in each round, and the winner of the round is determined by a set of rules specific to the game. Sort of like how Rock Paper Scissors works.
I'd like to be able to offer this game online where 2 players can find and play against each other. There would be some central server to arbitrate the game, and then each player would interact with the game using some game client of his choice that we would provide (i.e. web-based, mobile-based, Flash, etc).
Obviously, a player could also play against a computer opponent that we could provide. I'd also like to have the capability to allow programmers to submit computer programs that they've written to act as players and play against other programs in some sort of tournament.
I realize that the specifics of my game would certainly need to be written from scratch, but it seems that all of the work that the servers would have to do to communicate with the clients and maintain the state of the game has probably been done many times before. This is probably the bulk of the work.
Does anyone have any ideas for how this could be done quickly and easily? Are there servers available with some sort of standard interface to drop new games into? Is there some sort of open source game server? How would you go about doing this?
Seeing as the clients only communicate with the game server occasionally (as opposed to continuously), a web framework should be able to serve as your "basic game server". While web frameworks may be made for providing "web pages", they can certainly be (ab)used to serve as request handlers.
This certainly doesn't force you to make the game a browser game; standalone game clients can be made easily, and they can communicate with your game server using basic http. I also heard this thing called Ajax is pretty nifty for such things.
Not only will you find a lot of ready-made http-based servers, as an added bonus, there is a lot more documentation on how to work with Web 2.0®©™ than "game servers". You just need to know that you want a web framework that lets you easily manage sessions and receive/respond to requests and a client library that does likewise.
As an added aside, "maintaining the state of the game", as you put it, falls 100% within the domain of the actual game logic. But many web frameworks come with good database support, and will surely be useful for this kind of thing.

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

Flash CS4/AS3 Writing local file from local game without save dialog prompt?

I'm writing a game to be run locally, on the user's computer. NOT over the internet.
I want to have a file that will hold the usernames and avatar indices (they're in an array).
I want to know if there's a way to write to files through Flash with AS3. I'm using CS4.
I'd also like to know if you can delete files through Flash, though that's just optional.
Thanks in advance for any help you can give.
If you want to make a game that runs locally on someone's computer, you should make it in Adobe AIR. AIR apps can read and write files, and do all sorts of useful things like show updates in the taskbar, etc. Whereas a simple SWF that you download and run locally can't do anything useful that it couldn't already do in the browser - it can't write or delete local files, for a start. (It can read local files, but only if you disable it from accessing the network.) Moreover, the standalone Flash player is not generally disseminated, so unless the user is a Flash developer they're just going to view your SWF in a browser anyway (unless you plan to publish projectors, which I also wouldn't recommend).
With all that said, however, even if you do your game as local flash content, you can still store information by using SharedObjects. They work the same way offline as online. You can't write the data out as a separate file, but you can store it between sessions easily enough.
if i understand what you are trying to do then why dont you use Adobe AIR? this is flash for the desktop