XNA Creators Club Online
Page 1 of 1 (7 items)
Sort Posts: Previous Next

MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

Last post 08/06/2009 10:08 PM by Danny Tuppeny. 6 replies.
  • 07/06/2009 9:00 PM

    MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Hi all,

    I'm trying to read visualisation data for music on the Xbox. I've set IsVisualizationEnabled to true and data is returned for my game-provided sounds. However if I play my own custom music on the Xbox, all the samples return 0.

    Is this by design? I was under the impression this method was so that we could react to a users own soundtracks, and I had what I think is a cool idea, but it only works if a user can use their own music :-(

    Has anyone had this work or able to test it?

    Thanks
  • 08/06/2009 6:21 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Visualization data is only available for songs that are played by your game code, via MediaPlayer.Play.  If the user is playing custom soundtracks directly via a dashboard UI (in which case MediaPlayer.GameHasControl is false) the visualization data will not be available.

    You can play library songs and albums via MediaPlayer.Play, if you previously look those up through the MediaLibrary API, in which case visualization data will be available for them.
    XNA Framework Developer - blog - homepage
  • 08/06/2009 6:44 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Hi Shawn,

    Thanks for the response. Is it likely this could ever change? I think having games that react to the users music could be a cool feature, but the current implementation just isn't very useful :( If you're trying to detect BPM or something to control your game, you could just as easily hard-code it if we're restricted to the songs included in our game.

    I had what I thought was a cool idea for my next project, but the whole thing relied on being able to get this info for custom songs (I don't really want to post it here, just in case it changes!). It's a shame it's not possible - I'd already written some code to do the sound processing!

    Is it worth me opening a Connect issue, or are there technical restrictions making this unlikely to change?
  • 08/06/2009 7:18 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Danny Tuppeny:
    Is it likely this could ever change?


    I have no idea.  If you'd like to see it change, please file this as a suggestion on Connect to make sure the relevant people get to look at this request.

    Danny Tuppeny:
    If you're trying to detect BPM or something to control your game, you could just as easily hard-code it if we're restricted to the songs included in our game.


    You aren't restricted to the songs included with your game, just to the songs whos playback was triggered by your game. You can get visualization data to songs played by your code using the MediaLibrary API.
    XNA Framework Developer - blog - homepage
  • 08/06/2009 9:03 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Shawn Hargreaves:
    You aren't restricted to the songs included with your game, just to the songs whos playback was triggered by your game. You can get visualization data to songs played by your code using the MediaLibrary API.
    Woot! I misunderstood your first post. I just tested this (using MediaLibrary) and it works! I can still do what I was planning :-)

    Slightly off-topic, but since you're here.... Is there anything you can tell us about the 3.1 release schedule? I know it was planned for May - is it close, or has it been held up?
  • 08/06/2009 9:55 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Danny Tuppeny:
    Is there anything you can tell us about the 3.1 release schedule?


    As always about such things, no comment from me!  Sorry :-)
    XNA Framework Developer - blog - homepage
  • 08/06/2009 10:08 PM In reply to

    Re: MediaPlayer.IsVisualizationEnabled = true, but all samples are 0 on Xbox playing custom soundtracks

    Shawn Hargreaves:
    Danny Tuppeny:
    Is there anything you can tell us about the 3.1 release schedule?


    As always about such things, no comment from me!  Sorry :-)
    Worth a try, eh? :-)

    Maybe if I tempt you with a free copy of MyFirstAvatarGame when it's start^h^h^h^h^hfinished?...
Page 1 of 1 (7 items) Previous Next