Skip to contentSkip to conversation

aplay patch to add a --seek parameter

DISCUSSION Lars Magne Ingebrigtsen 3 participants 4 messages Apr 14, 2011 – Apr 16, 2011

lore
Share & tools
lore
#0 lore raw

I'm using aplay in a sound editor to play PCM files. But I need to be able to say "start playing at point X" to be able to skip around in the file.

I've used the following patch for years, but I think I forgot to submit it for inclusion into alsa-utils.

Signature · 3 lines
-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/

_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

#1 lore raw
Quoted 6 lines · Lars Magne Ingebrigtsen

I'm using aplay in a sound editor to play PCM files. But I need to be able to say "start playing at point X" to be able to skip around in the file.

I've used the following patch for years, but I think I forgot to submit it for inclusion into alsa-utils.

Thanks.

Please provide a Signed-off-by tag, document whether this option takes samples, frames, or (milli)seconds, and add this option to the man page. Furthermore, the code doesn't look as if it correctly skips over chunks in VOC files.

Regards,
Clemens

#2 lore raw
Quoted 4 lines · Clemens Ladisch

Please provide a Signed-off-by tag, document whether this option takes samples, frames, or (milli)seconds, and add this option to the man page. Furthermore, the code doesn't look as if it correctly skips over chunks in VOC files.

The --seek number is in bytes, so it assumes that the caller knows what the internal structure of the file is. For my usage (which is a simple visual wave form editor), this makes sense, but specifying it in milliseconds would probably be even more useful, I guess?

I'm not that familiar with the aplay internals, but so if someone who are familiar were to transform the patch into "seek to millisecond X", that would be nice.

Signature · 3 lines
-- 
(domestic pets only, the antidote for overdose, milk.)
  bloggy blog http://lars.ingebrigtsen.no/
#3 lore raw
In reply to Lars Magne Ingebrigtsen

2011/4/15 Lars Magne Ingebrigtsen <[email protected]>

Quoted 8 lines

I'm using aplay in a sound editor to play PCM files. But I need to be able to say "start playing at point X" to be able to skip around in the file.

I've used the following patch for years, but I think I forgot to submit it for inclusion into alsa-utils.

it depend on X is byte or frame

when X is an odd number and the format is S16_LE , aplay just produce noise