20 May '13 - 10:15 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: Get all Speakers from Soundcart and more  (Read 781 times)
cool_Jack
Posts: 35


« on: 13 Aug '11 - 20:55 »
Reply with quoteQuote

Hello together Smiley

Sorry but I have a lot of questions Smiley
I'm at a loss Sad

1. I search for a function to get all possible speakers from a soundcart.
2. In other software, the user can select "Speaker Front" oder "Speaker Front Left". I use the function Bass_Speaker_Pair1 2,3,4 etc... my question: where is the link between this?
3. I use the function "bass_StreamCreateFile...." in future I will use Asio. Can I integrate Asio in my exist Code?
4. Is there an function to activate the playback from a microphone? I try it with Windows API, but with Windows 7 it doesn't work.

Thanks a lot!
My Software developed in VB.Net
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #1 on: 15 Aug '11 - 16:08 »
Reply with quoteQuote

1. I search for a function to get all possible speakers from a soundcart.

Do you want to get the number of speakers? If so, that is available via BASS_GetInfo (see the "speakers" value).

2. In other software, the user can select "Speaker Front" oder "Speaker Front Left". I use the function Bass_Speaker_Pair1 2,3,4 etc... my question: where is the link between this?

You can use BASS_SPEAKER_FRONT for the front pair of speakers, or BASS_SPEAKER_FRONTLEFT for the front-left speaker. Please see the "Speaker assignment flags" section in the documentation for details on the available speaker options.

3. I use the function "bass_StreamCreateFile...." in future I will use Asio. Can I integrate Asio in my exist Code?

Yes, you can support both normal BASS/DirectSound output and ASIO output (via BASSASIO), but they will require some different code paths, eg. via some "if" statements. When using ASIO output, you would need to add the BASS_STREAM_DECODE flag to your BASS_StreamCreateFile call, and use BASS_ChannelGetData to decode data from the file in the ASIOPROC callback function. Some examples of using BASS processing with ASIO output can be found the BASSASIO package.

4. Is there an function to activate the playback from a microphone? I try it with Windows API, but with Windows 7 it doesn't work.

I'm not entirely sure what you mean. Can you please elaborate?
Logged
cool_Jack
Posts: 35


« Reply #2 on: 20 Aug '11 - 20:22 »
Reply with quoteQuote

Thanks a lot!

To 2.: When I use "Speaker Front" or other Settings then I become a exeption. When I use "Pair 1" or other then the soundcard works fine.

To 3.:It is pity that there aren't some exaples for Bass Asio in Visual Basic .Net. I try to open and understand VB 6 Codes.

To the last point: Some people use Push To Talk to aktivate them microphone and deactivate it with a button in the radioautomation. So I search a function to activate the microphone so the people on the stream can listen to the voice Wink
I hope you can understand my bad english Smiley

Thanks

EDIT: I have developed a code, but at startup I become a exeption. Is there a extra license to use Bass Asio?
« Last Edit: 20 Aug '11 - 20:52 by cool_Jack » Logged
Chris
Posts: 1504


« Reply #3 on: 21 Aug '11 - 09:41 »
Reply with quoteQuote

Hi about the Mic Stuff.
Til XP It was easy to develope the Mic Stuff.
But as Vista Microsoft have rebuild complete the Audio Stuff.
It must be possible under Vista/Win7 but til now I haven`t find a working way.
Chris
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #4 on: 22 Aug '11 - 16:08 »
Reply with quoteQuote

EDIT: I have developed a code, but at startup I become a exeption. Is there a extra license to use Bass Asio?

BASSASIO is licensed separately to BASS, but that won't cause an exception! Please post the code that is triggering the exception, and give any details that you have on it, eg. what type of exception is it?
Logged
cool_Jack
Posts: 35


« Reply #5 on: 26 Aug '11 - 18:19 »
Reply with quoteQuote

This is the complete Code:

Imports Un4seen.Bass
Imports Un4seen.BassAsio

Public Class Form1
    Dim strm As Integer
    WithEvents Test As New MyAsioHandler
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Bass.BASS_SetConfig(BASSConfig.BASS_CONFIG_UPDATEPERIOD, 0)
       
        Bass.BASS_Init(0, 48000, 0, 0, Nothing)
       'initialize ASIO devices
        If (BassAsio.BASS_ASIO_Init(0) = 0) Then
            Call MsgBox("Can't initialize device 1")

        End If

        BassAsio.BASS_ASIO_SetDevice(0) 'set the ASIO device to work with
        BassAsio.BASS_ASIO_Stop()   'stop the device
        BassAsio.BASS_ASIO_ChannelReset(0, -1, BASSASIOReset.BASS_ASIO_RESET_ENABLE Or BASSASIOReset.BASS_ASIO_RESET_JOIN) 'disable & unjoin all output channels


        strm = Bass.BASS_StreamCreateFile("C:\test.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE Or BASSFlag.BASS_MUSIC_FLOAT)

        If strm = 0 Then
            MsgBox("Can't play the file")
            Exit Sub
        End If

        'start ASIO output
        Dim i As BASS_CHANNELINFO, a As Long

        BassAsio.BASS_ASIO_ChannelEnable(0, 0, New ASIOPROC(AddressOf Test.AsioOutputCallback), strm) 'enable 1st output channel...
        For a = 1 To i.chans - 1
            BassAsio.BASS_ASIO_ChannelJoin(0, a, 0) 'and join the next channels to it
        Next a
        BassAsio.BASS_ASIO_ChannelSetFormat(0, 0, BASSASIOFormat.BASS_ASIO_FORMAT_FLOAT) 'set the source format (float)
        BassAsio.BASS_ASIO_ChannelSetRate(0, 0, i.freq) 'set the channel sample rate
        BassAsio.BASS_ASIO_SetRate(i.freq) 'try to set the device rate too (saves resampling)
        If BassAsio.BASS_ASIO_Start(0) = 0 Then 'start output using default buffer/latency
            MsgBox("Can't start ASIO output")
        End If
    End Sub
End Class

But a error appears on start.
In German: "Fehler beim Ausführen des Projektes. Die Datei oder Assemply 'BassAsio' oder eine Abhängigkeit davon wurde nicht gefunden. Im Modul wurde ein Assemplymanifest erwartet."

English version: "Failed to execute the project. The file or Assemply 'BassAsio' or one of its dependencies was not found. The module has a Assemplymanifest was expected."
Logged
radio42
Posts: 4012


« Reply #6 on: 27 Aug '11 - 19:21 »
Reply with quoteQuote

At which line do you get the error?
Also note, that you need to make the ASIOPROC callback delegate globaly - else it would be garbage collected - see the BassNet docs for details.
Logged
cool_Jack
Posts: 35


« Reply #7 on: 27 Aug '11 - 20:39 »
Reply with quoteQuote

The error comes with startup without mark a line.
I had read the Doc but a complete callback exapmle is not in there Sad
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines