Csound Csound-dev Csound-tekno Search About

Filled question

Date2016-12-04 10:17
Fromrmgls
SubjectFilled question
Hello all,

Please, can you tell me if filelen is able to report mp3 filelen?
my experience here is that this is not always the case:
filelen can be 2 or 4 times shorter.
Perhaps it is related to filenchnls in this case?

here is an excerpt of my play.csd.

Thanks in advance.

Raoul
rmgls@orange.fr



-odac3



sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

   gichn filenchnls "$NAME" ;; batch macro

instr 1
   ilen filelen "$NAME"
   ires strcmp "$READER", "mp3in"
   if ires == 0 then
      event_i "i", 2, 0, ilen
print ilen
   endif

   ires strcmp "$READER", "soundin"
if ires == 0 then
      event_i "i", 4, 0, ilen
endif

endin

instr 2 ; play mp3 audio from disk
   a1, a2 mp3in "$NAME", 0, 0, 0, 64 ;; 0 = skip... 64 is ibufsize default 4096
   outch 1, a1, 2, a2    ;; stereo only at this time
endin




i 1 0 5
e




Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-12-04 11:45
FromJohn ff
SubjectRe: Filled question
I thought you should use the mp3len opcode not filelen

Sent from TypeApp
On 4 Dec 2016, at 10:18, rmgls <rmgls@ORANGE.FR> wrote:
Hello all,

Please, can you tell me if filelen is able to report mp3 filelen?
my experience here is that this is not always the case:
filelen can be 2 or 4 times shorter.
Perhaps it is related to filenchnls in this case?

here is an excerpt of my play.csd.

Thanks in advance.

Raoul
rmgls@orange.fr

<CsoundSynthesizer>
<CsOptions>
-odac3
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

gichn filenchnls "$NAME" ;; batch macro

instr 1
ilen filelen "$NAME"
ires strcmp "$READER", "mp3in"
if ires == 0 then
event_i "i", 2, 0, ilen
print ilen
endif

ires strcmp "$READER", "soundin"
if ires == 0 then< br> event_i "i", 4, 0, ilen
endif

endin

instr 2 ; play mp3 audio from disk
a1, a2 mp3in "$NAME", 0, 0, 0, 64 ;; 0 = skip... 64 is ibufsize default 4096
outch 1, a1, 2, a2 ;; stereo only at this time
endin

</CsInstruments>

<CsScore>
i 1 0 5
e
</CsScore>

</CsoundSynthesizer>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here

Date2016-12-04 12:44
Fromrmgls
SubjectRe: Filled question
Oh! Sorry I was not  aware of this opcode.

Thanks a lot.

Raoul

I thought you should use the mp3len opcode not filelen

Sent from TypeApp
On 4 Dec 2016, at 10:18, rmgls <rmgls@ORANGE.FR> wrote:
Hello all,

Please, can you tell me if filelen is able to report mp3 filelen?
my experience here is that this is not always the case:
filelen can be 2 or 4 times shorter.
Perhaps it is related to filenchnls in this case?

here is an excerpt of my play.csd.

Thanks in advance.

Raoul
rmgls@orange.fr

<CsoundSynthesizer>
<CsOptions>
-odac3
</CsOptions>

<CsInstruments>
sr = 44100
ksmps = 32
nchnls = 2
0dbfs = 1

gichn filenchnls "$NAME" ;; batch macro

instr 1
ilen filelen "$NAME"
ires strcmp "$READER", "mp3in"
if ires == 0 then
event_i "i", 2, 0, ilen
print ilen
endif

ires strcmp "$READER", "soundin"
if ires == 0 then
event_i "i", 4, 0, ilen
endif

endin

instr 2 ; play mp3 audio from disk
a1, a2 mp3in "$NAME", 0, 0, 0, 64 ;; 0 = skip... 64 is ibufsize default 4096
outch 1, a1, 2, a2 ;; stereo only at this time
endin

</CsInstruments>

<CsScore>
i 1 0 5
e
</CsScore>

</CsoundSynthesizer>

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here