locked
Microsoft.Xna; microphone problems RRS feed

  • Question

  •  ok I am reading in from the microphone. I am also play back what I hear and that works fine.

    However when I display the values it is not working right.

    I know  this because when I do not make any noise and record, I still get high values like this 


    • Edited by Btb4198 Monday, September 30, 2013 9:16 PM
    • Moved by Caillen Tuesday, October 1, 2013 7:52 AM
    Monday, September 30, 2013 9:06 PM

Answers

  • Hi,

    This forum should be a better place for your question: XNA Framework forum.

    Please post there for more responses.

    Thanks for your understanding.


    Caillen
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Proposed as answer by Just Karl Tuesday, October 8, 2013 10:34 PM
    • Marked as answer by Just Karl Wednesday, October 16, 2013 12:32 AM
    Tuesday, October 1, 2013 7:52 AM

All replies

  • it goes up to over 250 and I am not making any noise ... I can play it back and I do hear a  humming  noise... idk why.. will more like white noise then  humming  ... 

    idk

    • Edited by Btb4198 Monday, September 30, 2013 9:19 PM
    Monday, September 30, 2013 9:18 PM
  • this is with sound

    it is the high is still around 250...

    why ?

    how do I fix this?

    it should be 0 when i am not making sound 

    here is my code 

     void  graph(ZedGraphControl zgc)                      

     {

                      

     GraphPane myPane = zgc.GraphPane;
                         // Set the titles and axis labels
                myPane.Title.Text = "My Test Graph";
                myPane.XAxis.Title.Text = " Time";
                myPane.YAxis.Title.Text = "My Y Axis";
                // Make up some data points from the Sine function
                PointPairList list = new PointPairList();

                double temp2;
                buffer = new Byte[1024];
                SByte[] bufferS = new SByte[1024];

                    double n = 0;
                    for (int n2 = 0; n2 < Microphone1.buffer.Length; n2++ )
                    {
                        temp2 = Microphone1.buffer[n2];
                        list.Add( n, temp2);
                        n = n + 0.00002267D;

                    }

               

     myPane.XAxis.MajorGrid.IsVisible = true;
                myPane.YAxis.MajorGrid.IsVisible = true;
                myPane.XAxis.MinorGrid.IsVisible = true;
                myPane.YAxis.MinorGrid.IsVisible = true;
                LineItem myCurve = myPane.AddCurve("Input", list, System.Drawing.Color.Blue, SymbolType.Circle);

                zgc.IsShowHScrollBar = true;
                zgc.IsAutoScrollRange = true;
                zgc.AxisChange();
                zgc.Refresh();   

        }

      public void record()
            {
                // Get audio data in 1/2 second chunks
                microphone.BufferDuration = TimeSpan.FromSeconds(1);

                // Allocate memory to hold the audio data
                buffer = new byte[microphone.GetSampleSizeInBytes(microphone.BufferDuration)];

                // Set the stream back to zero in case there is already something in it
                stream.SetLength(0);

                // Start recording
                microphone.Start();
            }

    I am using both 

    using Microsoft.Xna;

    and

    using Microsoft.Xna.Framework.Audio;

    so what should I do ?

    Monday, September 30, 2013 9:29 PM
  • Hi,

    This forum should be a better place for your question: XNA Framework forum.

    Please post there for more responses.

    Thanks for your understanding.


    Caillen
    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    • Proposed as answer by Just Karl Tuesday, October 8, 2013 10:34 PM
    • Marked as answer by Just Karl Wednesday, October 16, 2013 12:32 AM
    Tuesday, October 1, 2013 7:52 AM
  • how do I move it??? how do I move this post?
    Tuesday, October 1, 2013 4:32 PM
  • Hi,

    You can't move it there, just post a new question in the XNA Framework forum.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, October 7, 2013 1:30 AM