sb_voice_init()
{
        extern  char far * near voice_drv;
        int i;

        if ( ! GetEnvSetting() )
        {
                 if (sbc_check_card() & 4)
                 {
                               if (sbc_test_int())
                               {
                                        if (sbc_test_dma() >= 0)
                                        {
                                                 if ((voice_drv = LoadDriver("CT-VOICE.DRV")) != 0)
                                                 {
                                                               if (!ctvm_init())
                                                               {
                                                                       ctvm_speaker(1);
                                                                       return(0);
                                                               }
                                                 }
                                                 else
                                                 {
                                                         printf("Error loading CT-VOICE.DRV!\n");
                                                         return(1);
                                                 }
                                        }
                                        else
                                        {
                                                 printf("Error on DMA channel.\n");
                                                 return(1);
                                        }
                               }
                               else
                               {
                                        printf("Error on interrupt.\n");
                                        return(1);
                               }
                 }
                 else
                 {
                               printf("Sound Blaster Card not found or wrong I/O settings.\n") ;
                               return(1);
                 }
        }
        else
        {
                 printf("BLASTER environment not set or incomplete or invalid.\n");
                 return(1);
        }
}

sb_voice_exit()
{
       ctvm_speaker(0);
       ctvm_terminate();
}

playsample(char far *buf, char wait)
{
       ctvm_stop();

       buf += ((VOCHDR far *)buf)->voice_offset ;
       ctvm_output(buf);

       if(wait)
          while(ct_voice_status != 0);

}