[oss-devel] New to OSS

Rizwan Khan rizwaan at gmail.com
Thu Jun 28 03:05:19 EEST 2007


 Hello

thanks a lot for your detailed reply, I just wanted to confirm that if
am on track and not doing wrong, I am sendig you what i wanted to
achievee, please let me know, if i am doing any thing wrong and
suggest me any thing usefull in this regard.

 I want to prototype a linux based sound recorder using OSS which has
 this type of interface methods.

 SRecorder...

    bool Open(... device, samplerate, channels...);
    void Start();
    bool WaitForDataAndRead(LThread& Interface, int16_t* Buffer);
    void Stop();
    samplecount_t FlushData(int16_t* Buffer);
    void Close();
 I want that audio should be 16 bit PCM.

Thanks
On 6/28/07, Hannu Savolainen <hannu at opensound.com> wrote:
> Rizwan Khan kirjoitti:
> > Hello
> >
> > I am new to OSS and needs your expert advise.
> > I want to prototype a linux based sound recorder using OSS which has
> > this type of interface methods.
> >
> > SRecorder...
> >
> >    bool Open(... device, samplerate, channels...);
> >    void Start();
> >    bool WaitForDataAndRead(LThread& Interface, int16_t* Buffer);
> >    void Stop();
> >    samplecount_t FlushData(int16_t* Buffer);
> >    void Close();
> > I want that audio should be 16 bit PCM.
> >
> > At the moment, I am following this exacmple program and started with:
> > http://manuals.opensound.com/developer/audiolevel.c.html
> >
> > in this program i am concerned about:
> > (a) What is the blocking mode (does read block)
> >
> Yes. Reads will block until the requested amount of recorded data is
> available.
> >      - if blocking how do we determine the number of samples ready
> >
> You can call SNDCTL_DSP_GETISPACE to find out how many bytes of recorded
> data is currently available. However doing this doesn't necessarily make
> the program better.
> > (b) Is close missing there?
> >
> Close is missing because this program will never exit. It will keep
> running until somebody kills it.
> > (c) Did this work?
> >
> It did work.
> > Also - how what devices are possible as the input to this program.
> You can use ossinfo -a -v and look for the devices that report "Mode:
> IN" or "Mode: IN/OUT". Programs can use the SNDCTL_AUDIOINFO call to
> find out which devices support recording.
> >  And how its map from device name back to device?
> >
> You can call SNDCTL_AUDIOINFO (on the file descriptor returned by
> open()) and use the device name returned in the name field.
>
> Best regards,
>
> Hannu
> _______________________________________________
> oss-devel mailing list
> oss-devel at mailman.opensound.com
> http://mailman.opensound.com/mailman/listinfo/oss-devel
>


-- 
Muhammad R!zwän Khän



More information about the oss-devel mailing list