N64® Functions Menu

al - Audio Library Functions
gDP - DP GBI Macros
gdSP - General GBI Macros
gSP - SP GBI Macros
gt - Turbo Microcode RDP
gu - Graphics Utilities
Math - Math Functions
Mus - Mus Library
nuSys - NuSystem
os - N64 Operating System
sp - Sprite Library Functions
uh - Host to Target IO
64DD - N64 Disk Drive

Nintendo® Confidential




Mus Library Reference


MusInitialize()

Initialize the music player and audio player.

Syntax

  int MusInitialize(musConfig *config);

Arguments

  • config is the address of configuration structure

Explanation
Initialize the music player. This function installs and configures the library thread. Once called, the library API functions can be used. If the relevant entries in the configuration structure are present, then a default sample bank and a default sound effect bank will be defined.

The configuration structure located at the config address contains the following data:

  typedef struct
  {
    int           control_flag;
    int           channel;
    OSSched       *sched;
    int           thread_priority;
    unsigned char *heap;
    int           heap_length;
    unsigned char *ptr;
    unsigned char *wbk;
    void          *default_fxbank;
    int           fifo_length;
    int           syn_updates;
    int           syn_output_rate;
    int           syn_rsp_cmds;
    int           syn_retraceCount;
    int           syn_num_dma_bufs;
    int           syn_dma_buf_size;
    OSPiHandle    *diskrom_handle;
  } musConfig;

Return Value
The amount of memory, from the heap, used by the music player and audio manager.

Example

  int InitMusicPlayer(void)
  {
    musConfig init;

    init.control_flag = 0; 
    init.channels = 24;
    init.sched = &scheduler;
    init.thread_priority = 12;

    init.heap = &audio_heap[0];
    init.heap_length = AUDIO_HEAP_SIZE;

    init.fifo_length = 64;

    init.ptr = &ptr_buffer[0];
    init.wbk = &_wbankSegmentRomStart[0];

    init.default_fxbank = NULL;

    init.syn_output_rate = 44100;
    init.syn_updates = 256;
    init.syn_rsp_cmds = 4096;
    init.syn_retraceCount = 1;
    init.syn_num_dma_bufs = 36;
    init.syn_dma_buf_size = 0x1000;

    /* Please delete the following command */
    /* if using a sample stored in 64DD ROM */
    /* init.diskrom_handle = osDriveRomInit(); */

    return (MusInitialize(&init));
  }



Nintendo® Confidential

Warning: all information in this document is confidential and covered by a non-disclosure agreement. You are responsible for keeping this information confidential and protected. Nintendo will vigorously enforce this responsibility.


Copyright © 1998-1999
Nintendo of America Inc. All rights reserved
Nintendo and N64 are registered trademarks of Nintendo
Last updated March 1999