[ecasound] Playback and buffering on sound cards

From: <dougf@email-addr-hidden>
Date: Fri Sep 14 2012 - 11:25:26 EEST

 Hi all

 I have been using ecasound for quite some time now for enabling my wife
to dictate medical reports and it has worked superbly.

 Now I have a need to write transcription software (that is playback
controlled by foot pedals so a typist can transcribe them.)

 I have two problems - which are related to each other.

 Firstly ecasound gives me incomplete playback - which I believe is at
least in part due to buffering on the sound card.  I can get around that
by adding "silence" to the end of the audio files to be transcribed
(although a fix would be rather nice).  In my case the "lost" audio time
is significant because I have a need to keep the size of the audio files
to a minimum and so am recording 1 channel, 8 bits and 11,025KHz.  "Lost"
time depends upon the computer being used (presumably the sound card) but
is typically 50 to 100 seconds.  At CD quality recording we would only be
talking say 10 seconds or less and for 5.1 etc even less.  I would be
interested in knowing if others have this same experience and its not just
some setup fault on my part.

 For transcription I need the ability to pause the audio, rewind a little
and continue when requested.  This means I need to be able to find out
the position I am at.  (Works fine when recording).  But in playback
mode the various get-position functions get not the position of what has
been played back but the position in what has been sent to the sound card
- in other words for much of the time it is ahead of what has been played
by the contents of the buffer.  I rather desperately need a way around
this.  In the short term I might have to do my own separate timing
outside of ecasound.  I did write some code interacting with ALSA
directly (doesn't seem to want to run on Ubuntu 12.04.1) and overcame the
buffering issue by using the ALSA API function snd_pcm_delay - this was
the interface code I wrote (for Harbour):

 HB_FUNC( ALSA4H_PCM_DELAY )
 {
   snd_pcm_sframes_t delayp;
   hb_retni( snd_pcm_delay( ( ( snd_pcm_t * ) hb_parptr( 1 ) ),
   hb_storni( delayp, 2 );
 }

 I guess that I've played with ALSA enough to know just how great it is to
have ecasound and the ECI but an ECI command to get the delay would be just
wonderful.  Maybe it already exists or there is a solution to this issue
but if so I haven't been able to find it.  I only wish I had the
capability to contribute such an enhancement myself.

 This is not only important for transcription but would be appreciated
when dictating as one could then go back and replay what one has just said
and optionally record over something that you want to change.

 Thanks for reading and thanks Kai for ecasound.

 Regards
 Doug
 

------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html

_______________________________________________
Ecasound-list mailing list
Ecasound-list@email-addr-hidden
https://lists.sourceforge.net/lists/listinfo/ecasound-list
Received on Fri Sep 14 12:15:03 2012

This archive was generated by hypermail 2.1.8 : Fri Sep 14 2012 - 12:15:03 EEST