Giter VIP home page Giter VIP logo

Comments (6)

vgmoose avatar vgmoose commented on May 27, 2024

I thought I commented on this already...

Yes, this would be amazing! For the customization, we could probably rig it to ignore the A-B looping if it's loading from SD. I don't think it needs to get pedantic enough to support customization of the timing.

I made Issue #20 today, which would probably load the sound from a content/ folder, which may put the future of the customizable music up in the air. (I suppose it could still load from an override folder on sd:/)

from wiiu-space.

CreeperMario avatar CreeperMario commented on May 27, 2024

So we could load mods from the /vol/content folder, and from the SD Card in the RPX build.

I like that idea, but that does raise one issue. Does HBL provide us with a content folder? In this case, we will need to detect whether the title ID is one belonging to Mii Maker, or if it is your own. (BTW you need to pick a title ID, like, now. http://wiiubru.com/forum/forum/viewtopic.php?f=2&t=97 is the database. Just saw shinyquagsire23/makefst#1)

from wiiu-space.

CreeperMario avatar CreeperMario commented on May 27, 2024

Once idea for this would be to use ID3 tags. We could add looping to the soundtrack if it contains the ID3 tags loopA and loopB, and use their values. (error-checked, of course.)

This could be an optional step, and if these tags are omitted, the program will just loop the entire file.

from wiiu-space.

vgmoose avatar vgmoose commented on May 27, 2024

BTW you need to pick a title ID, like, now.

Whoops, changed the title ID to 00050000-00055225 in 2637578. I had wondered what you were referring to with this comment. 😊 The title ID is now a reference to the invincibility code. (although 99 lives is more fun to play)

Back on topic, ID3 tags do sound like an amazing workaround. Are there standard ones for this type of A-B looping or would other ID3 tags have to be piggybacked off?

from wiiu-space.

CreeperMario avatar CreeperMario commented on May 27, 2024

Are there standard ones for this type of A-B looping or would other ID3 tags have to be piggybacked off?

After looking very, very closely at the ID3 tag specification (v2.3, documentation here and here) I have decided that the best way to implement looping via ID3 is to use the General Encapsulated Object (GEOB) frame.

This frame allows us to attach any file, with any MIME type and any file name. So, we attach a file called abloop.txt with MIME type text/plain and have it contain the following contents (as an example)

649941
4433358

Notice the newline at the end of the file.

So, when loading the custom MP3 file (or WAV file with .mp3 extension - ask @dimok789 why) we will read its ID3 tag database (I just made a portlib out of libid3tag, its version matches that of @dimok789's libmad port, hopefully it will do the job correctly) and interpret the GEOB tag. (not quite sure how to do this yet).

Once the data has been fetched from the tag, we will then parse it. From the beginning of the file to the first newline character will be interpreted as the first loop point, and will be sub-stringed (probably with strncpy()) and will be converted to a long int (probably with strtol()). This resulting long will then be used to loop the file. From after the first new line to the second new line will be the second loop point, and interpreted as such.

One issue we face is that the user might give us some invalid numbers, which means we need to check the values for integrity. Namely, we cannot have negative numbers, because there are no negative samples in a sound file. 😐 We also have the limitations of a long int, which means that we cannot loop more than 2,147,483,647 samples (which, assuming my maths is correct, is about 12 hours of 48kHz audio, not that we will ever actually load something that large. 😇) which means that we should error check if an overflow has happened (strtol() does this for us).

Another issue is that this is not very user-friendly. Most ID3 tag editors will not allow you to edit the GEOB, so a specialised (probably command-line) tool will need to be used in order to actually achieve this looping style.

In the time that I spent researching for and writing this, I probably could've earned another twenty stars in Super Mario 64 DS, but meh.

from wiiu-space.

CreeperMario avatar CreeperMario commented on May 27, 2024

I am almost there, I have ID3 tag reading for MP3 files and VorbisComment reading for OGG files, but I don't yet have any metadata parsing for WAV files.

Though I don't think I will bother with WAV metadata, because there are six different types of metadata formats available for the WAV format, and that's just the accepted standards!. I also don't think parsing looping and soundtrack info from WAV files is necessary because WAV files are uncompressed, and HUGE! A 30 second WAV file took the same amount of space as a 6 minute MP3 file.

Though if I do decide to go through with parsing metadata from WAV files, one of the acceptable formats is ID3, which I've already implemented, so I can just copy the code for that. But that doesn;t speak for the other metadata formats.

Source: http://wavmetadata.blogspot.com/ (yes, there's a blog dedicated to it)

from wiiu-space.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.