help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: playing simple wave files


From: Mike Miller
Subject: Re: playing simple wave files
Date: Tue, 10 May 2016 14:55:18 -0700
User-agent: Mutt/1.6.0 (2016-04-01)

On Tue, May 10, 2016 at 11:45:30 -0700, John Gagnon wrote:
> I am attempting to use my cell phone and Octave to play a few .wav files to a
> "remote" bluetooth speaker
> I am new to Octave with some experience with MatLab I downloaded OCTAVE to
> my laptop and wrote the following short code and it worked fine on my
> laptop:
> 
> % sound play back
> % For use on cell phone
> %
> fil = input( 'Choose wave file 1=sweep01 2= chord01 3=pulse03-50-1k
> 4=mls01');
> x = input ('Enter number of playbacks');
> if fil== 1 
> [y, fs]=wavread('sweep01.wav');
> elseif fil== 2 
> [y, fs]=wavread('chord01.wav');
> elseif fil== 3 
> [y, fs]=wavread('pulse03-50-1k.wav');
> elseif fil== 4 
> [y, fs]=wavread('mls01.wav');
> end
> 
> for i = 1:x 
> %do
> % while (x 
> sound(y, fs);
> end
> 
> 
> I don't understand if it works on the laptop it should work on the phone...

Sure, let's just say your “phone” is a computer system, then this same
generic advice applies.

Your operating system must have libsndfile and portaudio available and
working, and if Octave was built for your system with those libraries
present and enabled, then audio file I/O and sound card I/O should work.

If you didn't configure and compile Octave yourself, then a first step
would be to see if those features are present, try

  __have_feature__ ("PORTAUDIO")
  __have_feature__ ("SNDFILE")

in Octave. If PORTAUDIO returns false, then you don't have sound card
I/O. If SNDFILE returns false, then you don't have audio file I/O.

-- 
mike



reply via email to

[Prev in Thread] Current Thread [Next in Thread]