NSData to .wav file and then to Ultrasound (20 to 22 KHz)

1k views Asked by At

In my app I have to do data transfer via ultrasound (20 to 22 kHz).. I have one idea to do that... i.e.,

At Sending side:

1.First I ll convert my data(NSdata or NSString ... ) to .wav file(I really don't know is it possible?)

2.I ll convert that converted .wav file to ultrasound (20 to 22 KHz) or simply play that in loud speaker

At receiving side:

1.It ll convert received ultrasound(20 to 22 kHz) or recorded .wav file from other device to NSData

My question is, Is it possible to convert data(NSdata or NSString ... ) to .wav file?, and then is it possible to produce ultrasound(20 to 22KHz) from .wav file? It may look silly... I don't know It ll work.. But please tell ur idea about this

1

There are 1 answers

0
Vinupriya Arivazhagan On

I merely designed a way to this. I didn't work it out, but I think it will give you an idea.

At sending side:

  1. first convert your NSData to byte stream
  2. then convert that byte stream to .wav file
  3. then play your .wav file with (20 to 22 kHz) by http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html

At receiving side:

  1. play your received sound(20 to 22 kHz) by http://www.cocoawithlove.com/2010/10/ios-tone-generator-introduction-to.html
  2. then convert low frequency .wav file to byte stream
  3. then convert byte stream to NSData