[Csnd] Filled question

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] Filled question

rmgls
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
[hidden email]

<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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Filled question

jpff
I thought you should use the mp3len opcode not filelen

Sent from TypeApp
On 4 Dec 2016, at 10:18, rmgls <[hidden email]> 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
[hidden email]

<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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] Filled question

rmgls
In reply to this post by rmgls
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 <[hidden email]> 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
[hidden email]

<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
[hidden email]
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 [hidden email] 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 hereCsound mailing list [hidden email] 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