OGG files in Bukkit

Discussion in 'Plugin Development' started by retsrif, Feb 7, 2011.

Thread Status:
Not open for further replies.
  1. Offline

    retsrif

    How can you play an OGG file, say by right clicking a lever? You would use on onBlockRightClick, but what would be the code you perform when detecting that?
     
  2. Offline

    Archelaus

    I assume you're trying to add sound effects to everything. This cannot be done without some kind of client to stream the music. This cannot be done via Bukkit.
     
  3. Offline

    fullwall

    Maybe if you use an OGG player built into your plugin, this is possible. I guess just call an OGG library that reads the file. Not sure of which to use/ how to set up though.
     
  4. Offline

    monotonehell

    You might want to rethink what you just typed there ;)
     
  5. Offline

    fullwall

    ? I have no experience with OGG files XD, so something may be wrong.
     
  6. Offline

    monotonehell

    OGG files are sound files. If your plugin plays a sound file... who will hear it?
     
  7. Offline

    fullwall

    Ahhhh. True XD.
     
  8. Offline

    retsrif

    Actually, I dont plan on giving sound to everything. What I plan is to have a music file (an OGG file) play after being triggered by an action. I just want to get it to play before I implement placing whatever songs you want in the plugin. For example, in singleplayer, when ghasts hit lava, they start to scream. How can I do this but with a pull of a lever? (And yes I know implementing it on a server is different than singleplayer, though all I want is a basic outline.)
     
  9. Offline

    maxx001

    How do you imagine that a player would hear this OGG? Your plugin runs on your server down in some basement which propably means no one is there to hear it, yet alone of the server has speakers :D
     
  10. Well the client downloads the current music files from the internet and plays them, i would think Bukkit would find a way to send music files from the server to the client somehow right?
     
  11. Offline

    retsrif

    maxx: good point. i probably need to stream the music to them... Anyone know some ways I can do that? I mean how to get Bukkit recognize the action performed, contact the client which holds the files, and then stream that specific file to the players?
     
  12. Offline

    ahmeni

    Unfortunately this is not something you can currently do with Bukkit as the client does not support having music streamed to it. You've basically got a few options, two of which require a client patch:

    - You could implement streaming music in the client. This would be very difficult and way more trouble than it's worth.
    - You could implement handling a custom packet that lets the client know to play a music file locally. This would be easier but still difficult if you don't have any experience patching the client. This would also require the client to have the music pre-downloaded.

    - If you're willing to do much simpler songs then you can directly send noteblock packets (Packet54PlayNoteBlock) to players. The client requires a nearby noteblock for this to work though. sq89q has done a midi player like this and it works nicely.
     
  13. Offline

    retsrif

    Seems like my choices are limited... how has the last.fm plugin gone around this?
     
  14. Offline

    alexgeek

  15. Offline

    croxis

    Best way is to install a shoutcast/icecast - type of server alongside the minecraft server. Create a bukkit plugin that communicates with the audio server. Have your players connect their favorite media player to the shoutcast server.

    Tada! Streaming music, audio, even text to speech!
     
  16. Offline

    retsrif

    alexgeek: Oh my bad. I never really looked at the plugin, just assumed you heard.
    Croxis: yeah an external client would be the best, though frankly, not worth all the trouble... I think I'm going to abandon this idea until bukkit implements some kind of sound system.
    Thanks for all your help guys.
     
Thread Status:
Not open for further replies.

Share This Page