MicroKaraokeOfferPacket

public struct MicroKaraokeOfferPacket : Content

When a user starts the Micro Karaoke flow to sing and record part of a song, the server reserves a song slot for that user and returns into about their reservation, including the lyrics they should sing, what song it’s part of, and URLs for the vocal and no-vocal song clipe.

Returned by:

  • POST /api/v3/karaoke/mk/offer
  • The ID of this offer. Offers are good for 30 minutes (or until fulfilled with a snippet upload), and a user may only have 1 open offer at a time. If a user re-requests while the offser is open, they should get the same offer response. This prevents users shopping for the lyric they want to sing.

    Declaration

    Swift

    var offerID: UUID
  • Each song the server works on collecting (via piecing together multiple song clips from users) gets an ID

    Declaration

    Swift

    var songID: Int
  • The song title, as it’d appear in karaoke metadata

    Declaration

    Swift

    var songName: String
  • The artist, as they’d appear in karaoke metadata

    Declaration

    Swift

    var artistName: String
  • bpm

    Song tempo. May not be exact; used for the timing of the countdown prompt before recording starts.

    Declaration

    Swift

    var bpm: Int
  • TRUE if all the clips for this song must be recorded in portrait mode. FALSE if they all need to be landscape.

    Declaration

    Swift

    var portraitMode: Bool
  • Which song snippet is being offered (songs are divided into 30-50 snippets when configured for use on Swiftarr)

    Declaration

    Swift

    var snippetIndex: Int
  • The lyrics the user is supposed to sing. Generally 1-2 lines. NOT the entire lyrics for the song.

    Declaration

    Swift

    var lyrics: String
  • An URL that points to a .mp3 file containing ~6 seconds of the original song This clip will have the artist singing the lyrics of 1-2 lines of the song, for the user to listen to before recording.

    Declaration

    Swift

    var originalSnippetSoundURL: String
  • This is a karaoke backing snippet to play while recording. It will be the same part of the song as originalSnippetSoundURL but MAY NOT quite be the same duration (karaoke versions of songs are sometimes faster or slower tempo then their originals). As a karaoke track, this snippet won’t have main vocals, but it also could have slightly diffeent instruments/sounds.

    Declaration

    Swift

    var karaokeSnippetSoundURL: String
  • The time that this offer expires. If no upload has happened by this time, the user will need to request a new snippet offer, which will likely be for a different part of the song, or even a different song altogether.

    Declaration

    Swift

    var offerExpirationTime: Date
  • Declaration

    Swift

    init(from snippet: MKSnippet, song: MKSong, snippetDirectory: URL, lyrics: String) throws