processing-sound-archive icon indicating copy to clipboard operation
processing-sound-archive copied to clipboard

Loop doesn't loop

Open slambert opened this issue 10 years ago • 12 comments

Tried to use this example from the documentation with a .wav file in Processing 3.0 on OS X. It plays once and doesn't loop - no errors.

slambert avatar Oct 13 '15 17:10 slambert

Mr. Lambert! I just ran this code with the Sound library 1.3.1 on Processing 3.0 and it worked fine. I tried with an AIFF, WAV, and OGG. Maybe you are using an older version of the Sound library or there is something different about your file? Could you post the file for testing.

REAS avatar Oct 13 '15 18:10 REAS

Mr. Reas! My Sound library was out of date, but I just updated it and tried again. The files I've been trying I posted here. I just tried some other random one on my laptop, so there must be something up with these ones.

Maybe I can add some needed specs for the files to the documentation once I understand what they are...

slambert avatar Oct 13 '15 20:10 slambert

That's wonderful. I can mechanically add that information to the docs if you sort it out. This is a new issue for me, I haven't experienced files not looping. @wirsing will hopefully have some insight.

REAS avatar Oct 13 '15 20:10 REAS

I made one of the files a mono mp3 and it worked for me. So it is the file type. I could do some more testing using mediainfo and see what breaks it. Weird that it plays, but doesn't loop.

slambert avatar Oct 13 '15 21:10 slambert

Ok, for what it's worth, this worked:

General
Complete name                            : takemain(1).mp3
Format                                   : MPEG Audio
File size                                : 31.3 KiB
Duration                                 : 2s 194ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 115 Kbps
Writing library                          : LAME3.99.5

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Duration                                 : 2s 194ms
Bit rate mode                            : Variable
Bit rate                                 : 115 Kbps
Channel(s)                               : 1 channel
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 30.8 KiB (99%)
Writing library                          : LAME3.99.5

And this didn't work:

General
Complete name                            :takemain.mp3
Format                                   : MPEG Audio
File size                                : 56.3 KiB
Duration                                 : 2s 194ms
Overall bit rate mode                    : Variable
Overall bit rate                         : 209 Kbps
Writing library                          : Lavf55.19.104

Audio
Format                                   : MPEG Audio
Format version                           : Version 1
Format profile                           : Layer 3
Mode                                     : Joint stereo
Mode extension                           : MS Stereo
Duration                                 : 2s 194ms
Bit rate mode                            : Variable
Bit rate                                 : 209 Kbps
Channel(s)                               : 2 channels
Sampling rate                            : 44.1 KHz
Compression mode                         : Lossy
Stream size                              : 55.9 KiB (99%)

slambert avatar Oct 14 '15 21:10 slambert

Same problem. Mono worked fine with loop() and when you change the mono file to stereo, then it won't work.

sunwangshu avatar Nov 28 '15 18:11 sunwangshu

I just experienced this too: loop() fails on a stereo wav file. Converting the file to mono fixed the problem, but mono is kind of a bummer :)

It looks like there's a PR that attempts to fix this issue: https://github.com/processing/processing-sound/pull/69

cacheflowe avatar May 31 '16 17:05 cacheflowe

Setting up loop() as follows worked for me:

  file = new SoundFile(this, "YOUR_FILE");
  file.play();
  file.stop();
  file.loop();

P1P3L1N3 avatar Sep 08 '16 11:09 P1P3L1N3

#69 has been merged (4fe919033894da2b902db1e7da4fe3cec4983ddc); could someone please test the fix? Thanks!

kaoskorobase avatar Mar 23 '17 09:03 kaoskorobase

Not sure if still interested, but I just experienced this problem with a WAV file I created.

@P1P3L1N3's solution fixed it.

arifd avatar May 16 '17 12:05 arifd

I confirmed this issue still happening in 1.3.2. The MP3 file in stereo and VBR format won't able to loop. I converted to mono AND CBR format and it worked.

jackycute avatar May 17 '17 18:05 jackycute

@P1P3L1N3 solution worked for me too. I'm using Processing 3.3.6 on Windows 10. Worked with files .aiff, .wav and .mp3 directly downloaded from freesound.org

RodrigoGamboa avatar Jan 30 '18 18:01 RodrigoGamboa