[PD] readanysf_duration_speed

august august at alien.mur.at
Mon Oct 11 22:17:23 CEST 2010


Hi Oscar,

	According to the way readansyf~ interprets the file on disk (not a
	stream from the web) the length is fixed .   

	If you have PD running at 44100 Hz and load a file that is 42
	seconds long but has a samplerate of 22050 Hz, the output of
	readanysf will still say that the file is 42 seconds long.  It will
	also automatically adjust the speed (resampling) to 0.5 so that it
	sounds "correct" when playing at PD's rate of 44100Hz.

	Also, the float output marked as "length in seconds that have been
	played so far" in the help file  and which incrementally updates as
	you play the file....really is "position in seconds" inside the file
	relative to the sound file's internal samplerate.   This might be a
	bit confusiong.

	So, you have 4 variables to deal with.

		1) samplerate of audio file
		2) samplerate of pd
		3) speed of readanysf that can adjust the audiofile samplerate   
		4) length of file in seconds

	If I am not mistaken, to get the total perceived duration of
	playtime, the formula should then be:

	1/speed * length of file in seconds * youraudiofile_samplerate/pdsamplerate


		-august.


> Hi list,
> 
> I am using the audio player readanysf~ from August Black
> and i have some question:
> 
>  for the last outlet we have (samplerate, lenght in seconds, and others..)
> 
>   the length in seconds of the player is related to speed=1
>
> 
>   if i change the speed for example   speed=0.20 obsviously the
>   length of the file played is going to be more big..
> 
>   how much ?   how can i calculate the new lenght in seconds for a
> 44100 audio file?
>   this speed means 20% of 44100 samples per second?
> 
> any help is welcome!!
> 
>  best,
> 
>  oscar
> 
> -- 
> >>>http://noconventions.mobi/noish
> 
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

-- 
	-------------------
	http://aug.ment.org




More information about the Pd-list mailing list