Tzury Bar Yochay | 1 Nov 2010 18:06

Re: capturing the audio played on my computer's soundcard

Hi,
I am trying to create a very small program which capture the sound played on the machine.

I wonder if there is an hello-world exam,ple for doing so since the most I have come up with by far, out of, short trial and error was some little program which captured the MIC input device and not the Mixer.

I tried this on my laptop which runs Ubuntu Linux and have no idea how to set the device number which refers to the mix or whatever the name is.

thanks in advance,
Tzury
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Victor Lazzarini | 2 Nov 2010 11:35
Picon
Favicon

Linux Audio Conference - Call for Participation - website

[Apologies for cross-postings] [Please distribute]

Paper-submission, call-for-music and registration are now open
for the Linux Audio Conference 2011 - May 6-8 2011, Maynooth, Ireland

More information: http://lac.linuxaudio.org/2011/

As in previous years, we will have a full program of talks, workshops
and music.

The Linux Audio Conference 2011 will include several concerts. We are
looking for music that has been produced or composed entirely or mostly
using GNU/Linux or other Open Source music software for:
* The Electroacoustic Music Concerts
* The Linux Sound Night
* Sound installa tions
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Ross Bencina | 4 Nov 2010 23:31
Favicon

new PortAudio API overview documentation (DRAFT)

Hi Everyone

A little while ago someone mentioned we needed an up-to-date overview 
document for the PortAudio API. I've always thought there should be some 
kind of architectural overview on the doxygen main page here:
http://www.portaudio.com/docs/v19-doxydocs/index.html

Since I've been slinging mud about poor documentation elsewhere lately I 
thought I'd better clean up my act a bit, so here's a draft of a new API 
overview for the PortAudio doxygen main page. It's a pdf at the moment 
because that was easiest for me to share but I intend to merge the final 
version into the doxygen documentation so it ends up with the rest of the 
API docs. As I note in the pdf, in the final version all function and type 
names will be hyperlinked to the appropriate entry in the doxygen reference.

Here's the draft:

http://www.audiomulch.com/~rossb/junk/NewPortAudioDocOverview_DRAFT_20101105.pdf

It's a bit different from the ICMC paper and the Audio Anecdotes book 
chapter we've written before in that it doesn't include a tutorial or 
discussion of internal implementation details. This is intended as a 
top-down overview or map, with hyperlinks to all the relevant API functions 
and data types -- kind of a way in to the existing API documentation. 
There's probably a room for a PortAudio Internals document too, and of 
course we already have tutorials 
(http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart)

Please tell me what you think. All corrections/notes/omissions etc welcome. 
It's not as easy to read as the Audio Anecdotes chapter on the same topic --  
if there's an experienced editor/tech writer out there who would be willing 
to help me smooth it out please get in touch :-)

I'm considering doing a UML diagram of the whole public API.. it's a lot of 
work and I'm not sure it's needed but I'd be interested to hear what people 
think.

Thanks!

Ross 
Bjorn Roche | 5 Nov 2010 01:39
Favicon
Gravatar

Re: new PortAudio API overview documentation (DRAFT)

Ross! This looks terrific. The figure is a bit like something I tried  
to make a while ago and forgot about. Your figure is awesomer than  
what I was working on. I read it and have some minor corrections I am  
sending off list. I think it might be useful to add an FAQ section  
here even if there are FAQs elsewhere on the site just to cover the  
really top questions that get asked when someone is a total noob.  
Here's what came immediately to my mind.

What about reading and writing audio files? PortAudio doesn't do that.  
If you want to read and write files, one popular option is  
libSoundFile; however, there are many, many options for reading and  
writing sound files depending on your OS, licensing and other  
requirements.

Is PortAudio thread-safe? No. It is up to you to figure out how to  
ensure that PortAudio is used in a thread-safe manner. Above-and- 
beyond this, you must ensure that you do not perform certain  
operations such as mallocs, waiting on mutexs, or performing I/O while  
processing audio, as this may result in both audio quality problems,  
and, on some platforms, even more severe issues.
(this is mentioned in the callback section, but it's worth repeating.)

What about MIDI? PortAudio does not handle MIDI. For this, you may  
want to consider the PortMIDI library.

What about volume/pan/EQ controls on my sound device? For controlling  
the input and output volumes on your sound devices, you may want to  
use the PortMixer library.

What about sound processing and effects? You are talking about DSP, or  
Digital Signal Processing. That's cool, but PortAudio won't do it for  
you. You might want to ask on the Music-DSP list.

I want the sound that's coming out of the computer to be an input into  
my software! Unfortunately, this isn't part of most operating system's  
Audio I/O System, so it's not something you can do with PortAudio.

On Nov 4, 2010, at 6:31 PM, Ross Bencina wrote:

> Hi Everyone
>
> A little while ago someone mentioned we needed an up-to-date  
> overview document for the PortAudio API. I've always thought there  
> should be some kind of architectural overview on the doxygen main  
> page here:
> http://www.portaudio.com/docs/v19-doxydocs/index.html
>
>
> Since I've been slinging mud about poor documentation elsewhere  
> lately I thought I'd better clean up my act a bit, so here's a draft  
> of a new API overview for the PortAudio doxygen main page. It's a  
> pdf at the moment because that was easiest for me to share but I  
> intend to merge the final version into the doxygen documentation so  
> it ends up with the rest of the API docs. As I note in the pdf, in  
> the final version all function and type names will be hyperlinked to  
> the appropriate entry in the doxygen reference.
>
> Here's the draft:
>
> http://www.audiomulch.com/~rossb/junk/NewPortAudioDocOverview_DRAFT_20101105.pdf
>
>
> It's a bit different from the ICMC paper and the Audio Anecdotes  
> book chapter we've written before in that it doesn't include a  
> tutorial or discussion of internal implementation details. This is  
> intended as a top-down overview or map, with hyperlinks to all the  
> relevant API functions and data types -- kind of a way in to the  
> existing API documentation. There's probably a room for a PortAudio  
> Internals document too, and of course we already have tutorials
(http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart 
> )
>
> Please tell me what you think. All corrections/notes/omissions etc  
> welcome. It's not as easy to read as the Audio Anecdotes chapter on  
> the same topic --  if there's an experienced editor/tech writer out  
> there who would be willing to help me smooth it out please get in  
> touch :-)
>
> I'm considering doing a UML diagram of the whole public API.. it's a  
> lot of work and I'm not sure it's needed but I'd be interested to  
> hear what people think.
>
> Thanks!
>
> Ross
> _______________________________________________
> Portaudio mailing list
> Portaudio <at> music.columbia.edu
> http://music.columbia.edu/mailman/listinfo/portaudio

-----------------------------
Bjorn Roche
http://www.xonami.com
Audio Collaboration
RJ Ryan | 5 Nov 2010 03:54
Picon
Gravatar

Re: new PortAudio API overview documentation (DRAFT)

This looks great Ross -- Nice job!


On Thu, Nov 4, 2010 at 8:39 PM, Bjorn Roche <bjorn <at> xowave.com> wrote:
Ross! This looks terrific. The figure is a bit like something I tried to make a while ago and forgot about. Your figure is awesomer than what I was working on. I read it and have some minor corrections I am sending off list. I think it might be useful to add an FAQ section here even if there are FAQs elsewhere on the site just to cover the really top questions that get asked when someone is a total noob. Here's what came immediately to my mind.

What about reading and writing audio files? PortAudio doesn't do that. If you want to read and write files, one popular option is libSoundFile; however, there are many, many options for reading and writing sound files depending on your OS, licensing and other requirements.

Is PortAudio thread-safe? No. It is up to you to figure out how to ensure that PortAudio is used in a thread-safe manner. Above-and-beyond this, you must ensure that you do not perform certain operations such as mallocs, waiting on mutexs, or performing I/O while processing audio, as this may result in both audio quality problems, and, on some platforms, even more severe issues.
(this is mentioned in the callback section, but it's worth repeating.)

What about MIDI? PortAudio does not handle MIDI. For this, you may want to consider the PortMIDI library.

What about volume/pan/EQ controls on my sound device? For controlling the input and output volumes on your sound devices, you may want to use the PortMixer library.

What about sound processing and effects? You are talking about DSP, or Digital Signal Processing. That's cool, but PortAudio won't do it for you. You might want to ask on the Music-DSP list.

I want the sound that's coming out of the computer to be an input into my software! Unfortunately, this isn't part of most operating system's Audio I/O System, so it's not something you can do with PortAudio.




On Nov 4, 2010, at 6:31 PM, Ross Bencina wrote:

Hi Everyone

A little while ago someone mentioned we needed an up-to-date overview document for the PortAudio API. I've always thought there should be some kind of architectural overview on the doxygen main page here:
http://www.portaudio.com/docs/v19-doxydocs/index.html


Since I've been slinging mud about poor documentation elsewhere lately I thought I'd better clean up my act a bit, so here's a draft of a new API overview for the PortAudio doxygen main page. It's a pdf at the moment because that was easiest for me to share but I intend to merge the final version into the doxygen documentation so it ends up with the rest of the API docs. As I note in the pdf, in the final version all function and type names will be hyperlinked to the appropriate entry in the doxygen reference.

Here's the draft:

http://www.audiomulch.com/~rossb/junk/NewPortAudioDocOverview_DRAFT_20101105.pdf


It's a bit different from the ICMC paper and the Audio Anecdotes book chapter we've written before in that it doesn't include a tutorial or discussion of internal implementation details. This is intended as a top-down overview or map, with hyperlinks to all the relevant API functions and data types -- kind of a way in to the existing API documentation. There's probably a room for a PortAudio Internals document too, and of course we already have tutorials (http://www.portaudio.com/trac/wiki/TutorialDir/TutorialStart)

Please tell me what you think. All corrections/notes/omissions etc welcome. It's not as easy to read as the Audio Anecdotes chapter on the same topic --  if there's an experienced editor/tech writer out there who would be willing to help me smooth it out please get in touch :-)

I'm considering doing a UML diagram of the whole public API.. it's a lot of work and I'm not sure it's needed but I'd be interested to hear what people think.

Thanks!

Ross
_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio

-----------------------------
Bjorn Roche
http://www.xonami.com
Audio Collaboration


_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Knut Inge | 5 Nov 2010 07:39
Picon

Re: 1st post and questions about building with MSVC2010 express on x64

Switching to MSVC 2010 professional (30-day trial) solved the issue for me.

On Thu, Oct 21, 2010 at 9:58 AM, Knut Inge <knutinh <at> gmail.com> wrote:
This is my first post so I should probably say hi to everyone

I am trying to build portaudio. I have studied the guide here:

Windows 7 x64
MSVC 2010 express
Latest DirectX SDK
ASIO SDK
Latest portaudio V19 SVN
.

_______________________________________________
Portaudio mailing list
Portaudio <at> music.columbia.edu
http://music.columbia.edu/mailman/listinfo/portaudio
Jim Barber | 5 Nov 2010 12:10
Favicon

Runtime crash when opening stream with MME, ASIO, WASAPI

Hello,

I've downloaded and installed both the "stable" and latest sources for 
Portaudio, and have compiled them with both VC2010 and VC2008 using the 
instructions from the tutorial. The ASIO2 SDK was downloaded from 
Steinberg just a couple of days ago.

The problem is that when Pa_OpenStream() is called with MME, ASIO or 
WASAPI devices, it causes the following error in my test app:

"An unhandled exception of type 'System.AccessViolationException' 
occurred in Portaudio Test.exe
Additional information: Attempted to read or write protected memory. 
This is often an indication that other memory is corrupt."

Interestingly enough, DirectSound devices *seem* to work, at least they 
don't crash.

The test programs in the "test" directory also fail in the same manner, 
however the pre-compiled test apps from the website do not. Since the 
pre-compiled continue to work after I rename portaudio_x86.dll to 
something else, I assume they were linked to a static lib instead of 
dynamically to portaudio_x86.dll ?

I have no doubt I'm doing something wrong, just not sure where to start. 
I can initialized Portaudio, enumerate devices and apparently use 
DirectSound devices without crashing.

I've tried various test apps on two different machines. One is x86 Vista 
and the other x64 Windows 7. ASIO devices I've tried include an EMU-0404 
on the x86 Vista box and an M-AUDIO Profire 2626 on the x64 Win7 box. 
Both systems will record and play back with Reaper without problems.

Oh - and I tried compiling a few of the command-line test samples with 
VC6 as well. Same problem occurs when using the portaudio_x86.dll I 
compiled myself with both VC2008 and VC2010.

Sorry for the rambling mail... It's 4AM and I think going to go fall 
into bed now... :-)

Thanks,
--jim
Tim Bunnell | 5 Nov 2010 14:08
Picon

Long latency on stopping a stream

I'm wondering if anyone has a suggestion for improving this...

We have an application where we would like to run the following sort of loop:

for (whatever) {
 <set mixer volume level>
 Pa_StartStream();
 Pa_ReadStream();
 Pa_AbortStream();
}

The point being to grab short buffers (50 msec) at a variety of volume levels as part of a calibration
process. Unfortunately, even if we leave the volume setting out of the loop, the best we can do for
capturing 50-msec buffers is about 5 cycles of the loop per second. We've encountered the same issue on a
Mac and on a Windows 7 system, and seemingly regardless of the suggested latency. We were hoping to get much
closer to the theoretical 20 buffers per sec.

Does anyone know why it should take ~200 msec to do one cycle of the loop, and crucially, does anyone have
suggestions about things to change that might speed it up?

Thanks,

t
---
Director, Center for Pediatric Auditory and Speech Sciences (CPASS)
Head, Speech Research Lab    | Adjunct Associate Professor
duPont Hospital for Children | Comp. and Info. Sciences / Linguistics
Voice: 1+302+651-6835        | University of Delaware
Fax:   1+302+651-6895        | URL: www.asel.udel.edu/speech/
Phil Burk | 5 Nov 2010 15:17

Re: Long latency on stopping a stream

Hello Tim,

> Does anyone know why it should take ~200 msec to do one cycle of the
> loop, and crucially, does anyone have suggestions about things to
> change that might speed it up?

It takes a while to setup the audio device, prime the buffers and start
the IO, sync with background threads. The 200 msec does not surprise.

Ideally you don't want to be starting and stopping the stream.  If you
can, just leave the stream running. Then output silence between tests.

Something like this:

   Pa_StartStream();
   for (whatever) {
      output silence;
      detect silence;
      <set mixer volume level>
      output signal;
      detect signal;
      measure amplitude;
   }
   Pa_StopStream();

By having a silent gap you can sync with your mixer changes.  Hopefully
changing the mixer will affect the live PortAudio stream.  You may be 
able to speed up this loop better than one that restarts the stream.

Phil Burk

On 11/5/10 10:08 AM, Tim Bunnell wrote:
> I'm wondering if anyone has a suggestion for improving this...
>
> We have an application where we would like to run the following sort
> of loop:
>
> for (whatever) { <set mixer volume level> Pa_StartStream();
> Pa_ReadStream(); Pa_AbortStream(); }
>
> The point being to grab short buffers (50 msec) at a variety of
> volume levels as part of a calibration process. Unfortunately, even
> if we leave the volume setting out of the loop, the best we can do
> for capturing 50-msec buffers is about 5 cycles of the loop per
> second. We've encountered the same issue on a Mac and on a Windows 7
> system, and seemingly regardless of the suggested latency. We were
> hoping to get much closer to the theoretical 20 buffers per sec.
>
Tzury Bar Yochay | 5 Nov 2010 15:28

Is anyone available to write a small program with portaudio

Hi,

I want to write a small, cross-platform program with port audio.
If you are up to this small project, mail me at tzury dot by at
reguluslabs dot com

thanks,
Tzury

Gmane