Re: Play sound in a different frequency
Re: Play sound in a different frequency
- Subject: Re: Play sound in a different frequency
- From: David Rowland <email@hidden>
- Date: Mon, 11 Apr 2011 09:28:48 -0700
Look into Audio Queue Services. You can mathematically create the sound, fill a buffer and send it to the output channel. You will have complete control over the waveform and won't have to deal with a file. I think your greatest problem will be finding a speaker and microphone capable of handling those frequencies.
D
On Apr 11, 2011, at 8:41 AM, Hugo Silva wrote:
> On 11/04/11 16:35, David Rowland wrote:
>> The sound is defined by the file. A WAV file usually represents samples at a rate of 44.1 kHz, meaning that it can reproduce sounds up to 22.05 kHz. That is just above the range of most human hearing. However, the amplifier and speaker (headphones, transducer????) may not be able to create a sound at that frequency.
>>
>> Why do you want to do this?
>>
>> David
>>
>>
>>
>> On Apr 11, 2011, at 3:03 AM, Hugo Silva wrote:
>>
>>> Hi,
>>>
>>> I need to play a sound, but an ultrasound, that can't be listen by humans.. I have this code to play the sound:
>>>
>>> AVAudioPlayer *myPlayer;
>>> NSMutableData *soundFileData;
>>> soundFileData = [NSMutableData dataWithContentsOfURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"beep-1.wav" ofType:NULL]]];
>>> myPlayer = [[AVAudioPlayer alloc] initWithData:soundFileData error:NULL];
>>> //if repeatedly playing the same sound, reset the playback pointer
>>> if ([myPlayer currentTime] != 0) [myPlayer setCurrentTime:0];
>>> [myPlayer play];
>>>
>>> This code plays a normal sound, that I can listen. How I can change the frequency to play sound but in a way that humans can't listen it?
>>>
>>> Best regards,
>>> Hugo Silva
>>> _______________________________________________
>>> Do not post admin requests to the list. They will be ignored.
>>> Xcode-users mailing list (email@hidden)
>>> Help/Unsubscribe/Update your Subscription:
>>>
>>> This email sent to email@hidden
> I need to generate a ultra sound to detect positions...
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden