Win a copy of Java Challengers this week in the Java in General forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

How does setMaxStreams in SoundPool work?

 
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

In a video I was watching about SoundPool, it mentioned setMaxStreams. The streamer said that setMaxStreams allows SoundPool to dedicate a portion of memory to each stream and set them up before it's even used.

This confused me since the name 'setMaxStreams' implies that this attribute limits the number of streams that can be played in a SoundPool. I checked the docs, and it said the same thing.

So does SoundPool's setMaxStreams prepare the streams ahead of time and limit the max number of streams?

Thanks!
 
Marshal
Posts: 3506
496
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The documentation says it: Sets the maximum of number of simultaneous streams that can be played simultaneously.

Since this is used in a context of a pool builder, it is likely as you say that memory for buffers and other per-stream-based resources get allocated when the pool is built based on this number.
 
Joe McMillan
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, I see. Thank you!
 
yeah, but ... what would PIE do? Especially concerning this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic