Quantcast
Channel: Processing Forum
Viewing all articles
Browse latest Browse all 1768

Re : Audio file stuttering whilst mp3 is playing?

$
0
0
First doublecheck your problem analysis. Is the problem loading the image, displaying the image or not related to the image at all. Use different test-sketches to pinpoint the exact problem. When I make a test sketch I can display 20 images of 10.000x664 pixels at a framerate of 60 fps. So no problem at all.

Test Sketch
  1. PImage test;
  2.  
  3. void setup() {
  4.   size(1200, 800);
  5.   test = createImage(10000, 664, RGB);
  6.   test.loadPixels();
  7.   for (int i=0; i<test.pixels.length; i++) {
  8.     test.pixels[i] = color(random(255), random(255), random(255));
  9.   }
  10.   test.updatePixels();
  11. }
  12.  
  13. void draw() {
  14.   background(0);
  15.   for (int i=0; i<20; i++) {
  16.     image(test, random(width), random(height));
  17.   }
  18.   frame.setTitle(int(frameRate) + " fps");
  19. }

If the problem is somehow related to the image, then some suggestions are:
  • Load the image in setup() once. This is not a suggestion, but a requirement!
  • Use the OpenGL renderer.
  • Divide the image into multiple smaller segments (you can do this in your program) and display the right ones.
  • Use a GLSL shader.

Viewing all articles
Browse latest Browse all 1768

Trending Articles