Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Supported by

How to close audio file after playing in Android

Hi all,

I am planning an oddball experiment to run on android smartphone. However, I cannot play more than 500 sounds and I get the error 'Too many open files'. Does someone know how to close the audio file after playing it to solve this problem? Thanks in advance!

Comments

  • Hi,

    I guess it depends on how you open them? If you use f.open(file) to open them, try f.close(file) to close it again.

    Eduard

    Buy Me A Coffee

  • Hi,

    I used the sampler item to play a audio wave file. I am not sure what would be the variable to use in this case? Thanks a lot!

  • Hi Ling,
    it might be worth trying to use the function
    sampler.stop()
    after each sound, perhaps this solves the issue, if it doesn't it'd be helpful to know a bit more about the exact configuration of your experiment and when the error exactly occurs.
    Attached an example that does play many sound in succession without errors, how does your experiment look compare?
    (sounds are not uploaded due to size restriction, so it'll only work if you add some sounds with the same names 'error1 - Copy(xx).wav')

    maybe useful:
    http://osdoc.cogsci.nl/3.1/manual/python/sampler/#function-sampler46close95sound40experiment41

  • Hi Roelof,

    The issue is now solved by entering the codes instead of using the gui interface to play the auditory file. Thank you so much!

Sign In or Register to comment.