Simultaneously Play and Record.

Hi
I'm working on a application where I need simultaneously Play and Record.
I followed the code of 'SpeakHere'. I got some success also. It is playing and recording simultaneously, but the problem is it plays audio through headphone speaker while recording. I wanted it to play through external speaker.
thanks.

That is, literally, all the code I have behind my "Enable Speaker" button. Are you sure you've set the Audio Session's category beforehand, and enabled it?
I see you're using the SpeakHere sample code. It does take care of setting up the audio session and enabling it. But it uses the "Media Playback" category of the audio session, rather than the "Play and Record" category.
Look for all the places in SpeakHere where they set the audio session's category (for playback) and change it to the "Play and Record" category. The property I mentioned above only takes effect in this category.
Good luck! If you're still having trouble, a chunk of code or some NSLog output might be helpful.

Similar Messages

  • Is Simultaneous Playing and Recording Impossible in Vis

    I have been scouring these forums for answers why this Sound Blaster X-Fi card running in Windows Vista can not record from an internal source, (Analog Mix, or What U Hear.) So far,all I found was that the Creative FAQ says that the Xtreme and Titanium cards are "excluded" from having "What U Hear" as a recording source. Did I read this right
    When is Creative going to release drivers that will allow me do do this thing that nearly all previous cards cound do, going back to the Sound Blaster Live Do you realize that the card is useless to me if I can't record from an internal source
    I look forward to your prompt response.

    You read it right I'm afraid.
    The *official* reply on these forums was in this thread.
    Both the X-Fi Platinum and Fatalty Champion Series have the "What U Hear" recording option in Vista or XP environment. There shouldn't be any difference in music production as both cards uses the same chipset. If you are into music production, I would suggest taking a look at the EMU systems too.
    I don't think this is a driver fix either.
    Funny you should mention the Li've as that can do "What U hear" with some drivers written by a guy who used to come on here.
    It really needs someome like him to look at this issue and tell us whether a driver work round would do it, but given as many other cards don't do it in Vista I have my doubts.
    Just seems the way sound chips work these days.
    The X-Fi XtremeMusic that Creative no longer make has it.

  • Can Express 9 play and record multiple instruments at the same time?

    I have logic express 9 and was told with my interface that I can play and record different instruments at the same time on Express 9. Is this true because I have spent a long time trying to figure out how.

    Hi,
    to record multiple Inputs at a time, open up the appropriate number of audio tracks. Now for each track, select the correct Input in the Channelstrip.
    Now, ARM all these tracks for recording by clicking the little red R in the track header or channelstrip. Now if you hit record, all these tracks should record simultaneously their respective inputs.
    All other existing tracks should playback while recording.
    Fox

  • When I connect my electric acoustic through an audio jack to usb there is a delay between playing and recording. Can this be overcome?

    when I connect my electric acoustic through an audio jack to usb there is a delay between playing and recording. Can this be overcome?

    Hi johnbwebster,
    Welcome to the Support Communities!
    The Logic Express 9 Manual shows how to Adjust the "Recording Delay" in the Audio Preferences:
    Click on the link below for more information and screen shots:
    Logic Express 9 User Manual: Audio Preferences in Logic Express
    https://documentation.apple.com/en/logicexpress/usermanual/index.html#chapter=43 %26section=4%26tasks=true
    Cheers,
    - Judy

  • Can I play and record minecraft on a mac pro

    I am currently playing minecraft on a windows pc with a 1GB graphics card. My graphics card has crashed while playing basic minecraft. I want to buy minecraft so I can do more and also install HD resource packs, but are unable to because of my computer. I have been advised to buy the new Apple Mac Pro, as it has a 6GB graphics card, but am wondering if minecraft will run on it and if so, how well. I also want to record minecraft and put it on youtube, but have noticed that most of the people who play minecraft have pc's to play and record it on. I have also noticed that mojang, who make minecraft are using pc's. Is there anybody who is using an Apple to play and record minecraft and if so, could you let me know how well it works and if you have uploaded it to youtube, please give me your link or username. I am looking at buying the new Mac Pro to run minecraft but am wondering if it will do what I want it to do and if anyone has any advise.
    Thankyou.
    William Evans

    You can only PLAY Blu-ray discs on a Mac by using one of several software's that untilize a Blu-ray license on the internet. What this means is that you must have a fast internet connection to play the disc on your machine. Apple refuses in support Blu-ray with their OS, so there's no way one can play BRD using their computers software in a stand-a-lone manner, like Windows users can.  This is one of those reasons for the love and hate relationships Apple creates  for controlling the market to their advantage, at a loss of one of the most common entertainment formats to their user base. They could easily support the format, they simply chose not to either out of stubborness or for money reasons. The latter makes you winder when they have so much of it now.
    Toast software, on the other hand, has the ability to burn Blu-ray discs, so you can at least use BRD for back-up.  You can also rip movies, etc. I purchased a small and nifty portable BR burner from Sony, Model BDX-S600U that was fairly cheap at the time for $149. It's now $178 at Amazon. It only interfaces witha computer through dual USB though (one is for additonal power), so you can't use it with your TV.  I use this device on my MacBook Air when I want to burn or play DVD's. I have tested the machine and it plays DVD movies and burns just fine. I've been so busy though, that I haven't actualy burned a BR data disc yet, but I know the Toast software supports it. Moreover, hard drives have become so cheap, that burning to BR isn't the best BU, but still uasable and great for mailing large files.
    Unfortunately, until Apple gets their HOOTA we may never see BR support because Tim Cook may just follow Steve Jobs lead out of respect. Yet, with new leadership, and Steve out of the way (Bless him), we may eventually see Apple support. Especially as they continue to merge iOS and OSX. I wouldn't hold your breath on it though.

  • Macbook Pro: Play and record sound at the same time

    Greetings everyone,
    My brother and I have are going to switch go a mac, preferebly to a macbook pro. we used windows so far, but the frustration has grown extremely huge, so it's time to throw off this junk.
    We've been working with sound a lot and many times we recorded any sound which played through the computer: that means sound and music from dvds and games or other sources, we couldn't get anywhere else. What we did is simply letting the game or dvd play and record the audio at the same time.
    I've testet this functionality in windows via bootcamp on a macbook of friend of mine, but NOT the macbook pro version. It's wasn't really that good as I thought. Sound quality was below what I'd expect.
    So here are my questions:
    - Does the macbook pro have a better sound card, which enables simultaneos play + record?
    - Is good record quality bound to a software I need to use?
    Thanks for your replies.

    Apple don't have separate "sound cards" like PC's , Martin. The necessary hardware is proprietary , and built into the logic boards.
    Both of them have high quality combined optical digital input and audio line in, and combined optical digital output and audio line out. You can also attach various USB or firewire audio input and output devices if you wish. So as far as 'quality" goes, it depends what you are playing them through more than anything else. The inherent audio abilities of both are pretty danged good when using Mac specific software. That is why the music industry love 'em!
    Or are you just talking about sound quality through the built in speakers, which are, of course severely limited by the amount of space available, though I've heard far worse from many PC notebooks!?
    Cheers
    Rod

  • Playing and recording sound

    Hello, I am completelly new in Java programing. I was assigned to search for how to play and record sound in an appliation in Java, can somebody help me?
    Thanks

    http://www.google.com.au/search?hl=en&q=java+play+sound&btnG=Google+Search&meta=
    http://www.google.com.au/search?hl=en&q=java+record+sound&btnG=Google+Search&meta=

  • Play and record simultaniously

    is it possible to play a song in a app and record video and/or sound within a app at the same time in a windows phone app? it works in windows 8 and since windows phone 8 has similar device capabilities I was wondering if it is possible.

    Hello
    When I first read your post, I couldn't believe it is possible to achieve without using C++ and WASAPI stuff. I immediatealy implemented it and launched on the emulator. I was really amazed how perfectly it worked (on the emulator). That was exactly
    the behavior I wanted and tried to implement in various ways for more than 4 months for now.
    Unfortunately, when I deployed it to the device I found out some imperfections that couldn't have been experienced on emulator.
    First, the music was playing from this quiet speaker used for regular phone calls (the one above the screen). The sound quality is poor, quiet and - which is more important - the volume up and down hardware buttons control the In-voice volume (10 possible
    settings) rather than Multimedia/apps one (30 possible settings). Even when I connected the headphones, the maximum sound volume was not even close to the one I could achieve using Multimedia/apps volume control.
    Second, the music playback stutters. I first though the phone is just overloaded with simultaneous music playback and video recording (with preview enabled), so I totally disabled the video preview and recording. Unfortunately, the audio playback still frequently
    stuttered. I found it always does when mediaElement.AudioCategory is set to Communications, no matter if video recording is on.
    Trying to fix out the first issue, I used both
    mediaElement.AudioDeviceType = AudioDeviceType.Multimedia;
    and
    mediaElement.AudioDeviceType = AudioDeviceType.Console;
    with no results. The music still played only from this phone call speaker above the screen. Then I tried using all the possible AudioCategories enumerations. Any other than Communications blocks simulataneous video recording, so I didn't use them.
    To try to fix the second issue, I used
    mediaElement.RealTimePlayback = true;
    but the playback still stutters :(.
    Is it possible to solve at least the second issue with the stuttering playback? It is unacceptable in my scenario to have the playback interrupted in any way. It is strange since the phone is not overloaded and the stuttering is not present when the AudioCategory
    is set to any other value. Or when the application is launched on the emulator...
    Many thanks in advance and Happy Easter :)
    Maciek

  • Unable to view Play and records buttons

    I am unable to view the bar with play, record, stop etc.

    Just position your cursor on the bottom edge of the Arrange window until your cursor appears as a solid black line with an arrow pointing up from the middle. Then either double-click or click and drag up until the Transport appears. You can also open the Transport in a separate window using CMD+7 or going to Window/Transport.
    Cheers

  • Simultaneous playback and record

    Hi all,
    I'm trying to assist our music department as they begin using Logic, but I am unfamiliar with the software. They have been unable to figure out how to play back their score while recording vocals at the same time. I assume that this is possible, and I'm wondering if someone here can point me in the right direction. Thanks!
    -Jonathan

    I'm not with you.
    When you are recording, whatever you have going on in the arrangement is also played back.
    Can you be more specific with what you are trying to do, what you have done, and the behaviour you see? Also what hardware you are using (audio interfaces etc).

  • Playing and recording

    Hi,
    I'm writing an application which is supposed to capture video from a webcam, copy it into a file and give the opportunity to watch the video at the same time. I've been able to do these tasks separately but when I try to get them together, catastrophe! BElow is the code:
    import java.lang.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.swing.*;
    import java.util.*;
    import javax.media.format.*;
    import java.awt.*;
    import java.awt.event.*;
    import javax.media.bean.playerbean.*;
    import com.sun.media.protocol.vfw.VFWCapture;
    public class Testeur{
    boolean ready=false;
    String filename;
    javax.media.protocol.DataSource datasource; //attach�e � la webcam
    MediaLocator source; //adresse de la webcam
    Processor p; //encode en quicktime le produit de datasource
    DataSource dsource; //sortie du processeur vers le datasink qui enregistre dans le fichier
    MediaLocator dest; //path du fichier de destination
    DataSink filewriter;
    DataSource ds2;
    Vector devices;
    public static void main(String []a)     {
         Testeur ts=new Testeur();
         while(!ts.ready){}
         System.out.println("we are ready");
         //create the thread which will take care of the affichage of the flux.
    //     Afficheur aff=new Afficheur(ts);
    //     System.out.println("displayer created");
    //     aff.run();
    public DataSource createDSClone(){
         DataSource newbie=null;
         try{
              //newbie=ds2.createClone();//the clone problem
              newbie=Manager.createCloneableDataSource(datasource);
              if(newbie!=null) System.out.println("newbie created!");
              System.out.println("could not clone datasource");
         catch(Exception e){
              System.out.println("exception while cloning datasource");
         return newbie;
         public Testeur(){
         String filename;
    javax.media.protocol.DataSource datasource; //attach�e � la webcam
    MediaLocator source; //adresse de la webcam
    Processor p; //encode en quicktime le produit de datasource
    DataSource dsource; //sortie du processeur vers le datasink qui enregistre dans le fichier
    MediaLocator dest; //path du fichier de destination
    DataSink filewriter;
    Vector devices;
         VideoFormat vidformat = new VideoFormat(VideoFormat.RGB);
    devices = CaptureDeviceManager.getDeviceList(vidformat);
    CaptureDeviceInfo di = null;
    if (devices.size() > 0){
              di = (CaptureDeviceInfo) devices.elementAt(0);
              System.out.println("informations :name [] "+di.getName()+" ;;locator [] "+di.getLocator().toString());
    else {
    JOptionPane.showMessageDialog(null,"Your camera is not connected", "No webcam found", JOptionPane.WARNING_MESSAGE);
    System.exit(1);
    try{
              //source=di.getLocator();
              //source= new MediaLocator("vfw:Microsoft WDM Image Capture:0");
              source= new MediaLocator("vfw://0RGB");
              System.out.println("Tasker2: locator "+di.getLocator().toString());//ok
              datasource=Manager.createDataSource(source);//does not pass this point
              System.out.println("datasource created!");
              //datasource=Manager.createCloneableDataSource(datasource);
         //     System.out.println("cloneable datasource created!!");
    *Le processeur va prendre la sortie de datasource, l'encoder en QuickTime
    *Puis, le DataSink va �crire le fichier .mov localis� en dest � partir des
    *donn�es  recueillies de source
         try {
              p=Manager.createProcessor(datasource);
         do{
    synchronized(p){
         System.out.println("processor created");
         Thread.sleep(20000);
              p.configure();
    while(p.getState()!=Processor.Configured){
              p.wait(10000);
    p.setContentDescriptor(new FileTypeDescriptor(FileTypeDescriptor.QUICKTIME));
         System.out.println("processor configured");
         break;
    while(!Thread.currentThread().isInterrupted());
         System.out.println("starting the wait cycle...");
         try{
         //processor configured, put record code here
         try{
              p.realize();
              do{
    synchronized(p){
         System.out.println("processor in the realizing process...");
         Thread.sleep(20000);
    while(p.getState()!=Processor.Realized){
              p.wait(10000);
         System.out.println("processor realized");
         break;
    while(!Thread.currentThread().isInterrupted());
         if(p.getState()!=Processor.Realized){
              System.out.println("not realized after 100s");
              System.out.println("current state :"+p.getState());
              System.out.println("configured "+p.Configured);
              System.out.println("realizing "+p.Realizing);
              System.out.println("realized "+p.Realized);
              System.exit(1);
         catch(Exception e){
              System.out.println("error while waiting for processor to realize");
              System.out.println("Message : "+e.getMessage()+" exception of type: "+e.getClass().getName());
              datasource.disconnect();
              System.exit(1);
         dsource = p.getDataOutput();
         dest= new MediaLocator( "file:output2.mov" );//instead, use filename variable
         System.out.println("destination media locator created!");
         filewriter = null;
              try {
              filewriter = Manager.createDataSink( dsource, dest );
              if(filewriter!=null) System.out.println("datasink created!");//ok
              filewriter.open();
              System.out.println("open...");
              filewriter.start();
              System.out.println("started...");//ok
              //ready=true;
              Afficheur aff=new Afficheur(this);//never displays, now!
         System.out.println("displayer created");
         aff.run();
              catch ( Exception e ) {
                   JOptionPane.showMessageDialog(null,
         "Exception : " + e.getMessage(), "Error", JOptionPane.WARNING_MESSAGE);
                             System.out.println("problem: "+e.getCause().getClass().getName());
                        datasource.stop();
                        datasource.disconnect();
                        System.exit(1);
         p.start();
              try {
                   Thread.currentThread().sleep(300000);
              catch (InterruptedException ie) {
              System.out.println("problem prob");
         System.out.println("All done!!");
         //release the ressources
    filewriter.stop();
    filewriter.close();
    p.stop();
    p.close();
    datasource.stop();
    datasource.disconnect();
         catch(Exception prc){
              System.out.println("problem configuring processor.");
         catch ( Exception e ) {
              System.out.println("processor problem"+e.getMessage()+" exception of type: "+e.getClass().getName());
              Thread.sleep(50000);
         catch (Exception e) {//pierre d'achoppement leads me here
    JOptionPane.showMessageDialog(null,
    "Exception locating media: " + e.getMessage(), "Error", JOptionPane.WARNING_MESSAGE);
    System.exit(1);
    import java.lang.*;
    import java.io.*;
    import javax.media.*;
    import javax.media.protocol.*;
    import javax.swing.*;
    import java.util.*;
    import javax.media.format.*;
    import javax.media.bean.playerbean.*;
    import javax.swing.*;
    import java.awt.event.*;
    import java.awt.*;
    public class Afficheur extends JFrame implements Runnable , ActionListener {
         Testeur ts;
         MediaPlayer player;
         MediaLocator ml;
         DataSource ds;
         //GUI
         JButton bView, quit;
         JPanel p;
         JComboBox cbx;
         public Afficheur(Testeur testeur){
         super("affichage de flux live");
         ts=testeur;
         //ds=ts.createDSClone();
         ml=ts.source;
         System.out.println("source : "+ml.toString());
         if(ds==null)
         System.out.println("unable to create the clone to the original datasource");//problem source
         //create the GUI
              p=new JPanel(new GridLayout(2,3));
              bView=new JButton("Visualiser camera");
              String [] albus={"vfw:Microsoft WDM Image Capture:0","meenie","minie","moe"};
              cbx=new JComboBox(albus);     
              p.add(cbx)     ;
              p.add(bView);
              setContentPane(p);
              this.setBounds(50,50,100,100);
              bView.addActionListener(this);
         //this.run();
         public void run(){
              //show the GUI and wait for orders.
         this.setVisible(true);     
         public void actionPerformed(ActionEvent e){
              JButton origin= (JButton)e.getSource();
                   //determine which cam is selected and launch the player.
              if(origin==bView){
                   System.out.println("you are about to view the flux");
                   try{
              //     player=new MediaPlayer();//1)
                   //player= (MediaPlayer)Manager.createRealizedPlayer(ds);// 2)
                   player= (MediaPlayer)Manager.createRealizedPlayer(ml);
                   System.out.println("player created");
                   Thread.sleep(10000);
                   *2) when done this way, we get to the catch clause,
                   *with a null message.
                   *today, we have a mass exception!
                   //player.setDataSource(ds);
                   player.setFixedAspectRatio(true);
                   player.setBounds(10,10,150,150);
                   player.realize();
    System.out.println("waiting for player to realize...");
    *we keep on waiting here until the Testeur finishes record the 300s of movie
                   player.waitForState(300);
                   System.out.println("player realized");
                   this.getContentPane().add(player.getVisualComponent());
                   setBounds(0,0,170,180);
                   setVisible(true);
                   System.out.println("about to start the player...");
                   player.start();
                   }catch(Exception et){
                        System.out.println("problem: "+et.getMessage());
                        System.out.println("problem: "+et.toString());
                        System.out.println("problem: "+et.getCause().getClass().getName());
              else{
                   if(origin==quit){
                             player.stop();
                             player.close();
                             this.dispose();
    Problems:
    1)the file cannot be viewed with any of the players I have on my computer: Windows Media Player and Real Player fail to play it. Even JMStudio can't!!
    2) when I click on the button to display the video, a null exception is thrown. sometimes, there's a message sayiong the player could not be created.
    I'm completely confused with this thing. Advice would be very appreciated!
    Thanks!

    Hi Mustansar,
    I have got the same problem. I use a clone datasource too, but I can not save anything.
    Have you resolve it?
    If yes, tell me like please
    Thanks a lot

  • Latence while playing and recording (Axiom 49)

    Hello,
    When i try to play with my Axiom 49 while playing a song or while trying to record myself, there is lag and I need to wait a little time before hearing the sound of my instrument. Also i need to press the key a certain time before i can hear the sound.
    My keyboard is plugged directly in my MacBook Pro, the problem is not coming from the computer, i think there something to do in Logic but i don't know what to do .
    Is there any way to change this ?
    Pierre

    Hello,
    I found a solution, a complete reinstallation of Logic solve the problem.

  • Playing and Recording while minimized

    I've noticed that Adobe Audition 3.0 will stop recording or playing when I open another window, or if I minimize it
    I looked this up in the forums, and found a solution of unchecking the "Release ASIO driver in background" button. I've tried that, but the problem is persisting.
    I've noticed that this is happening on two different computers, on the same edition. Is there anything else I should be trying here?

    http://www.google.com.au/search?hl=en&q=java+play+sound&btnG=Google+Search&meta=
    http://www.google.com.au/search?hl=en&q=java+record+sound&btnG=Google+Search&meta=

  • Xperia Z Tablet Video play and record problem

    Hello, I have a problem with xperis of the tablet . When shooting video is uploaded black screen and green bar at the top. Likewise, I do not play video . Video recorded from the Z1 Compact And sena to Z tablet, is not played on video app sony, or photo app from google, but I play him in BS Player. I try faktory restore. No change. Plese hele me. I have 4.4.4 kitkat

    Sorry to hear that you have issues playing videos.
    I recommend that you first try to repair the software in your tablet using a computer and PC Companion or Bridge for Mac: http://support.sonymobile.com/global-en/xperiatabletz/software/ but please note that this will delete all data on your tablet.
    If the issue should still remain I think that this needs to be examined and fixed at a repair center. For more information about how to submit your tablet for repair and where, contact your local support team.
     - Official Sony Xperia Support Staff
    If you're new to our forums make sure that you have read our Discussion guidelines.
    If you want to get in touch with the local support team for your country please visit our contact page.

  • Simultaneous playback and recording?

    I was wondering if there was some way I could record videos of myself while playing music?
    It seems that the built in camera app disables all playback functionality--which is pretty annoying, seeing as I want to record some stuff while music is playing.

    this is not possible, if you want to add music to your videos you must purchase iMovie for ios from apple.
    i'm not sure but i don't think there is another way on ios

Maybe you are looking for

  • Process chain questions

    Hai  All,            I designed a process chain with data flow like this: R/3>ODS1>ODS2>Cube. The process chain sequence is: Start>>Load data>>activate ODS1 data>>load data to ODS2>>activate ODS2 data>>delete index>>load data to cube.            My p

  • How can I see the photo quality settings in iLife'06 books

    I assembled a 100 page book using iLife'05 over the last week or so. Luckily I hadn't ordered the book before learning about the new "improved print quality" when using iLife'06. Well, iLife'06 finally arrived today and I installed it and... Well, do

  • Can see in appletviewer but not in browser

    Hy, I am trying to display a text on JTextArea using the code below. In appletviewer this is OK but I can not see the text on browser (IE 6, NS 8, Firefox 1.0.7). The browser only show a retangle applet. No exceptions. If I insert this two lines outp

  • Mountains and nearest neighbor do not mix

    Note - this is not an Oracle question - but something as food for thought. Appropriate I think as graph is now a big component of the product... While on vacation in Colorado last week, we decided to head up to Crested Butte to see a local play produ

  • Please help!! Pages 09 :: Pages Files Can not be read - The Document Does Not Have A Valid Format

    I used pages to write my coursework, but when I saved it, pages crashed... Now I tried to reopen the file. It shows "The document ___.pages can not be read - The Document Does Not Have A Valid Format". I've looked through the forum to find any fix me