How to get the length of a sample in buffer~ (in samples) ??

Learn about building and using Max for Live devices.
Post Reply
Parametex
Posts: 438
Joined: Sun Oct 17, 2004 4:34 pm

How to get the length of a sample in buffer~ (in samples) ??

Post by Parametex » Mon Dec 28, 2009 9:04 am

Hi,

I can't seem to find a solution for getting information (the length in samples) of the audio file that is loaded into buffer.

Anybody in the know please help,!

Cheers,
P.

henke
Posts: 258
Joined: Fri Sep 11, 2009 7:36 am

Re: How to get the length of a sample in buffer~ (in samples) ??

Post by henke » Mon Dec 28, 2009 10:30 am

info~ gives you the time in ms.
and the sample rate

---> all you need to calculate the length in samples

Robert

f.e
Posts: 21
Joined: Mon Dec 07, 2009 8:12 am

Re: How to get the length of a sample in buffer~ (in samples) ??

Post by f.e » Mon Dec 28, 2009 12:55 pm

use info~ to get length in ms.

then mstosamps~ to automatically get the length in samples, according to your project sample rate.

f.e

Parametex
Posts: 438
Joined: Sun Oct 17, 2004 4:34 pm

Re: How to get the length of a sample in buffer~ (in samples) ??

Post by Parametex » Mon Dec 28, 2009 4:13 pm

Done n' done!

Thx!!

pukunui
Posts: 405
Joined: Thu Jan 29, 2009 10:26 pm
Location: Los Angeles

Re: How to get the length of a sample in buffer~ (in samples) ??

Post by pukunui » Mon Dec 28, 2009 5:05 pm

I realise when you're stuck you want to get things resolved as quickly as possible, but could you please not cross post as a matter of course? This one was correctly posted in the MaxMSP forum, and now 4 different people in 2 different threads have spent time helping you.

Thanks

-A

Parametex
Posts: 438
Joined: Sun Oct 17, 2004 4:34 pm

Re: How to get the length of a sample in buffer~ (in samples) ??

Post by Parametex » Mon Dec 28, 2009 9:34 pm

pukunui wrote:I realise when you're stuck you want to get things resolved as quickly as possible, but could you please not cross post as a matter of course? This one was correctly posted in the MaxMSP forum, and now 4 different people in 2 different threads have spent time helping you.

Thanks

-A
Of course ... I actually was not dreaming of such quick responses on anything really ... My bad.

Yet thanks ,)
P.

Post Reply