Adobe Air + iphone microphone problem: low volume after SampleDataEvent.SAMPLE_DATA event - iphone

I am developing and iPhone app with Adobe Air 2.6 using Flash CS 5.5. I am trying to capture microphone input and then playback an mp3 file. The problem is now, that once I capture the microphone data with the SampleDataEvent.SAMPLE_DATA event, the volume of the playback mechanism seems to be decreased significantly.
To reproduce:
playback a (remote) mp3 file and the volume is ok
get the microphone and add the event listener (see code below), the listener function does not even need any code for this problem to occur.
same as step 1 (playback remote mp3) and the volume is very low.
// add the event listener
_microphone.addEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);
private function onSampleData(event:SampleDataEvent):void
{
//while(event.data.bytesAvailable > 0) {
// _buffer.writeFloat(event.data.readFloat());
//}
}
// call this before playing back the mp3
_microphone.removeEventListener(SampleDataEvent.SAMPLE_DATA, onSampleData);
When testing with the Flash IDE, the problem does NOT occur and everything works as expected. Tested on iPhone 3GS with iOS 4.3.3.
If anybody experienced this problem I would greatly appreciate your insights.
UPDATE:
I think it is not an AIR problem per se. After using the iOS Microphone the whole app almost mutes itself, that is also the case for the typing on the virtual keyboard (which does not come from AIR). Doesn't really help me but maybe somebody knows how to shut down the microphone in an app so that speaker levels get back to normal?
UPDATE 2:
Here you can see a running example from Adobe http://tv.adobe.com/watch/adc-presents/developing-for-ios-with-air-for-mobile-26/, note that the speaker volume of the iphone in the live demo is really low too. So that must be a pretty huge bug then, making the microphone on the iPhone unusable.

download and use AIR 3 sdk
then set
SoundMixer.useSpeakerphoneForVoice = true;
SoundMixer.audioPlaybackMode = AudioPlaybackMode.MEDIA;
and your problem should be solved

Related

How do I record a video of my iPhone app from the simulator?

I am using OSX mountain lion, and I have been able to record a video using quick time to screen capture, but it does not record the sound generated from the iOS Simulator, but rather from the microphone.
I want to record audio and video from the iOS Simulator.
You could:
- try a professional screen recording software (Camtasia, Screenflow,...)
- use a virtual sound output device that captures the sound and writes it to disk
- connect your sound output to your input (using a Cinch cable)
See http://bit.ly/UXBJ9N for more info on the latter two.
I ended up using sound flower (which I can't praise enough - it was much more simple than I expected - and tiny app size too) to capture audio, and a random screen capture utility to capture video, then I married them up in a video editing application. Not perfect, but it works.
I will post here if I find a simpler solution, because despite all the blog posts about this matter, I could not find something ideal.

Record Video of my running application in iPhone

I want to record a video of my application which is running on my iPhone and use it for Replay. How can I do that?
I was searching for this and could't find any solution.
Your only options are:
1. Run the app in the simulator and use any screen capture tool for mac to record a video
2. Fix the iPhone on a pod/stand and record video of you app with another camera
If the app does not have any feature which is available only on the device i would avoid option no 2, because iPhone's glossy screen shows all kinds of reflections and the user's hand in the video is really annoying..
Well, if your phone is a 4S you can get a dongle from Apple that outputs the video as a HD stream. The dongle lets you plug in a HDMI cable, so you would need some way to capture that output.

Playing movie in iOS applicatione made in Flex

I'm writing the application for iOS in Flex (sdk 4.5). Is it possible to play movie in such built application?
I was trying to use Video component - which works well on my desktop, but it doesn't work on my iPod. Of course my application is running, but the video isn't playing.
I think I have final results:
It is possible to play video in iOS app written for AIR 2.6 but it can't be decoded by using h.264 video and acc audio codecs.
For me it was working when video was decoded by using vp6 codec and standard Video component. There is an issue with low frame rate which can be partially resolved when setting renderMode to gpu in descriptor file, however as you can see here it's not recommended.
P.S. Thanks for help J_A_X.
I would recommend that instead of trying to play the video internal to your application, you just link to it and let the native OS handle it. The OS will either open up a browser to play the file or launch a native app to handle it.
Have you tried to use the StageVideo class? It's new in 10.2 and meant to utilize full hardware acceleration. Follow this tutorial for more information.

How can I lower the volume of iPod audio while my app plays a sound

I'm trying to reproduce the functionality of built-in Mail application when a new message arrives while you are listening to iPod music.
What happens with the Mail app is:
iPod's volume lowers a bit
Mail app plays a short sound and vibration
iPod's volume goes back to normal
I know how to play a sound and cause vibration, what I don't know is how to lower iPod's volume and restore it after my sound plays.
How can I reproduce this same functionality in my app with SDK 2.2? I know third party apps can't run in the background. My users will play the iPod then have my app in the foreground.
See my answer to that other question of yours ;)
[[MPMusicPlayerController iPodMusicPlayer] setVolume:x.y]
where you change x.y through a timer or as one-off. In OS3, of course.
Have you tried simply playing the sound? I suspect this is automatic functionality on the part of the SDK.
edit: according to this question, you can fade the ipod sound out but not back in.
(I'm surprised this functionality isn't automatic and default behaviour. But then I've always found the elegance of the apple APIs to be inversely proportional to the elegance of the interface :-)
This is not possible with iPhone SDK 2.2.1 or earlier. If you need this functionality please submit a bug to apple. I've submitted one but duplicates indicate interest so it might help promote this issue.
[[MPMusicPlayerController iPodMusicPlayer] setVolume:x.y] this will affect your ipod music player volume (allowed values are 0.0 to 1.0)
i hope vibration not allowed in ipod. if device have an option for vibration then we can do

Is there a way I can capture my iPhone screen as a video? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I want to be able to capture my iPhone's screen as a video, but I'm not sure the best way to do this.
Can anyone help guide me on how to best do this without jailbreak?
Here's my solution in a nutshell:
In recent years, when needing to produce moving visual content from the interface of an iOS app, I would require the developer provide a compiling of the app designed for the Simulator, (must be separately compiled because the apps are, by default compiled to run on the iPhone's ARM processor, whereas the Simulator runs on the Mac's Intel processor). This would then be screen captured on the Mac with something like Snapz Pro, Screenflow or something similar.
Beyond that, typical solutions required jailbreaking the device and installing a screen capture application sourced from the Cydia Store.
With the introduction of the iPad 2, Apple enabled full interface mirrored video output via either an authorized dock connector to HDMI dongle, or a dock connector to VGA dongle. (Note: Apple's composite and component options do not port mirrored content.) While the typical intent for these output mechanisms are to display the interface content to an external projector or High Definition Television, it is possible to record this mirrored content with a device capable of recording or transcoding content from such an incoming source. This option was also made possible with the introduction of the iPhone 4S. Quite often, recording this video content is done with HDMI capture cards installed on the capturing computer, such as those produced by Black Magic or AJA, among others. This is, or course limited to using computers that are capable of having such a capture card installed. Other options may include some HDMI record-enabled DVR devices (though many detect and disable such options) or firewire-based transcoding devices (like the Grass Valley ADVC-HD50, which I use).
Since getting the iPad 2 earlier this year, I have been using the Grass Valley ADVC HD50 to capture iOS screen motion from dock connected HDMI to a HDV compatible video capture application on my Mac. It has thus far worked flawlessly.
Here is an example from a video I recorded showing such captured content from both the iPHone 4S and the iPad 2.
http://youtu.be/k7jlPx8NAmw
However, now that Apple has enabled wireless iOS mirroring via Airplay in iOS 5, I find it is now much more convenient to connect an Apple TV device to the Grass Vally ADVC HD50, and capture the iOS interface screen recording wirelessly.
Here is a recent short video example in which the iPhone 4S interface was captured wirelessly via Airplay mirroring.
http://youtu.be/UKsixjcCXdI
I hope this helps.
As others have suggested, AirPlay mirroring is the way to go. To mirror directly to your computer use an AirPlay server like http://www.airserverapp.com/. Then, since it's showing up directly on your computer you can capture it using the built-in Quicktime app (File > New Screen Recording). Works great!
You can use Lookback. It records your screen, face, voice and all gestures, and uploads them to your account on the web.
Here's a demo: https://lookback.io/watch/JK354d5jcEpA7CNkE
Loren Brichter the developer of Tweetie2 wrote this little app called SimFinger to make iphone screencasts top notch!
http://blog.atebits.com/2009/03/not-your-average-iphone-screencast/
Love apps that make amateurs look like pros :)
I made a plugin for the simulator that does just this. You can find it at my blog.
It actually records the screen. It does not rely on another screen capture program like iShowU.
It will install icons for the default apps and change the carrier text to look like a real device.
Short of using a video camera, no.
Many youtube videos for demonstrating iPhone applications are made with a screen grabber application (such as iShowU, ScreenFlow, or Snapz Pro) and the simulator. Be aware that the speed of response in the simulator can be dramatically different than a device - so it's possible to get effects (and miss) with the simulator you'll never see on a device. In particular, default animations can flash by in the simulator, where they just look quick on a device.
using ScreenCaptureView class we can capture the iphone screen as video.The source code is available here.The recorded video is saved in a NSUrl,outputURL.Use that NSUrl in a method like below to play the recorded video,
-(void)playvideo
{
MPMoviePlayerController *player = [[MPMoviePlayerController alloc] initWithContentURL:outputURL ];
[player.view setFrame:CGRectMake(0,0,320,480)];
[player setMovieControlMode:MPMovieControlModeHidden];
[player setScalingMode:MPMovieScalingModeAspectFit];
[player setBackgroundColor:[UIColor blackColor]];
[player setFullscreen:YES animated:YES];
[player play];
[self addSubview:player.view];
}
call this method before releasing NSUrl in completeRecordingSession method ..it will replay what you did in the iphone screen as a video.
Note: This answer is outdated
www.iphonevideorecorder.com. There's a free trial I think, but after that you'd need to buy it. And you need to jailbreak your iphone.
You could use the video-out and capture that somehow with a firewire or sumthing..
The class MPTVOutWindow can help you out! Here's a nice sample of that!
http://iphone-developers-nc.googlegroups.com/web/UIApplication_TVOut.m
I used ScreenFlow to record the Simulator, and zoomed it and added static images as necessary. I then embedded the movie in an iPhone frame on my website. Turned out okay. See the Tweeps page for the result.
i guess it is so obvious now that no one has posted this but for the noobs.... note: iPhone 4S only
just airplay to an apple tv and video mirror then output the atv to a device that can record - like tivo, dvr etc. you can also use a video out cable on the iPad [1 and 2] now
not sure if the cable works on the iPhone 4S as I havent tested that myself
its clunky but there is no other way i can see atm.
I've continued to research this item myself, and it does appear to remain beyond us at this point.
I even tried buying a Apple Composite AV Cable, but it doesn't capture screen, just video playing like YouTube, etc.
So I decided to go with the iShowU path and that has worked out well so far.
Thanks Guys!
For a nice looking screencast, have a look at SimFinger. You will still need a screen recoder such as Snapz Pro.
Just for anyone who is still looking for solutions:
The RecordMyScreen jailbreak app is opensourced and works fine even on non-jailbreak devices if we have the developer license. You can have a look at the source: https://github.com/coolstar/RecordMyScreen
I dont believe this is possible.
Your best bet is to get something like iShowU and capture from the simulator.