VB6 - Monoton Audio Lib-VBForums
Results 1 to 13 of 13

Thread: VB6 - Monoton Audio Lib

  1. #1

    Thread Starter
    Lively Member rm_03's Avatar
    Join Date
    Aug 2004
    Posts
    92

    VB6 - Monoton Audio Lib

    Windows Media Player can play a lot of file formats, but its just not beautiful style.
    MCI can play a lot of file formats, you can even create a visualisation
    by recording from WaveOut.
    But when it comes to DSP, neither WMP nor MCI will give you any control over the data.
    There are alternatives like BASS or FMOD, but they're not completely free.
    So HOW does Winamp do that?
    I've spent the last 5 months figuring that out , the result is pretty good.
    Almost completely written in VB, just a few dependencies (lame ACM codec, lame_enc.dll, ogg.dll, vorbis.dll, vorbisfile.dll, MACDll.dll, WMF SDK/Runtime v9 ).

    Features:
    - decodes/plays WAV, MP3, OGG (Vorbis), WMA, APE, CDA
    - encodes WAV, MP3, OGG (Vorbis), WMA, APE
    - streaming playback with DirectSound 8
    - DSP, analysis (comes with FFT and IIR filters)
    - equalizer which theoretically supports up to 255 bands
    - already implemented: IIR filters (low/high/bandpass, notch, peak eq, low/high shelve), FFT (+ windowing with Hanning/Hamming/Blackman windows)
    - full ACM support
    - CDA decoder supports ASPI, SPTI and IOCTLs
    - system independent volume and pan settings (DirectSound)
    - all decoders but WAV/CDA read tags
    - comes with 4 examples:
    1. player (plays all supported formats, playlist, 3 visualisations (time/frequency domain, dBFS display), 5 band graphic eq, effects (high/lowpass, flanger, echo), displays tags)
    2. CD Ripper (grabs audio tracks, supports all encoders)
    3. format transcoder (converts between all supported formats)
    4. simple (simplest possible playback)

    Readme is important!

    If you have any problems, suggestions, comments, or any other feedback, please let me know!
    Attached Files Attached Files

  2. #2
    Super Moderator Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,335

    Re: VB6 - Monoton Audio Lib

    Although I downloaded it, I haven't taken a look yet.

    However, judging by the size of your zip file and the time spent on development and research, it looks like you put a lot of effort into this and it is appreciated.

    Fine job!
    Please use [Code]your code goes in here[/Code] tags when posting code.
    When you have received an answer to your question, please mark it as resolved using the Thread Tools menu.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    I dont answer coding questions via PM or EMail. Please post a thread in the appropriate forum section.

    Creating A Wizard In VB.NET
    Paging A Recordset
    What is wrong with using On Error Resume Next
    Good Article: Language Enhancements In Visual Basic 2010
    Upgrading VB6 Code To VB.NET
    Microsoft MVP 2005/2006/2007/2008/2009/2010/2011/2012/Defrocked

  3. #3

    Thread Starter
    Lively Member rm_03's Avatar
    Join Date
    Aug 2004
    Posts
    92

    Re: VB6 - Monoton Audio Lib

    Thanks Hack, yep, it took me about 5-6 months

  4. #4

    Thread Starter
    Lively Member rm_03's Avatar
    Join Date
    Aug 2004
    Posts
    92

    Re: VB6 - Monoton Audio Lib

    Monoton v2. Probably the first audio player written in VB which shows a little of the staggering work behind Winamp.
    It's not a DLL anymore, it's a real player. w00t.

    screenies:
    http://actorics.de/rm_code/code/monoton/monoton.jpg
    http://actorics.de/rm_code/code/monoton/monoton2.jpg


    http://actorics.de/rm_code/code/monoton/monoton.zip (4 MB)

    For those who can't get MP3/WMA to work:
    http://actorics.de/rm_code/code/monoton/wmfsdk.zip (3.8 MB)

    There are some binaries in the package, for those who can't compile
    C(++) or even Monoton.

    libs used:
    - WMF SDK (wma, mp3)
    - libsamplerate (resampling)
    - libsndfile (support for snd/au/aif/aifc)
    - ogg vorbis (well, the ogg format)
    - monkey's audio (ape format)
    - lame (mp3 encoder)

    ax used:
    - VBAccelerator SGrid 2 (playlist)
    - SSubTmr6 (used by the SGrid)

    Features are:
    • readable formats: wav, ape, au, snd, aiff/aif, aifc, voc/vox, ogg, wma, mp3, cda
    • writable formats (encoders!): wav, ape, wma, mp3, ogg
    • read/writable playlists: m3u, pls
    • Play/StopPause (!!)
    • setable volume/pan
    • Windows Mixer directly controlable
    • repeat modes: whole playlist, single, nothing, random
    • visualisation: frequency spectrum (FFT), amplitudes
    • 8 band graphical equalizer (with a nice visualisation of the spectrum amplifier curve, like in Winamp), save and load presets
    • effects: reverb (or is that called "echo"?), channel swap, phase shift, normalization
    • rip audio CDs, with FreeDB support (supports ASPI, SPTI and IOCTLs), normalization, downmixing and resampling
    • transcoder, converts from readable to writable formats, with normalization, downmixing and resampling
    • record from WaveIn, line to be recorded from can be selected.

  5. #5
    New Member
    Join Date
    Jan 2007
    Posts
    4

    Re: VB6 - Monoton Audio Lib

    This is by far the best open source project I've seen written in VB classic. I have run into one problem with it though. When I try to change increase the EQ to more than the default 8 bands I receive nothing but distortion during playback. Is the constant EQ_BANDS the only variable controlling the number of bands?

  6. #6
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Re: VB6 - Monoton Audio Lib

    As always rm_03, a very nice example! I'm particularly interested in the ripping aspects, and am struggling with the Lame MP3 codec. Using the monoton app. in the bin folder, I can rip to MP3 - but in the project I get 'Encoder Not Initialised'.

    The lame encoder DLL is in the project directory, so I don't understand why this is behaving this way. Can you shed some light on this please?

    Oh, there's also a bug in the FreeDB library, I'll try and fix that when I can in your project and let you have the results - but right now have it working in my own separate library.

  7. #7
    New Member
    Join Date
    Jan 2007
    Posts
    4

    Re: VB6 - Monoton Audio Lib

    Quote Originally Posted by VorTechS
    As always rm_03, a very nice example! I'm particularly interested in the ripping aspects, and am struggling with the Lame MP3 codec. Using the monoton app. in the bin folder, I can rip to MP3 - but in the project I get 'Encoder Not Initialised'.

    The lame encoder DLL is in the project directory, so I don't understand why this is behaving this way. Can you shed some light on this please?

    Oh, there's also a bug in the FreeDB library, I'll try and fix that when I can in your project and let you have the results - but right now have it working in my own separate library.
    Try copying the lame dll to your windows system directory when running from the IDE. Also I'm not sure what bug your referring to in the FreeDB class, I have yet to encounter any problem.

  8. #8
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Re: VB6 - Monoton Audio Lib

    Okay, rather than copy to the system32 directory, I modified LoadDLL to specify the app.path - and that looks to have resolved my immediate problem loading the DLLs.

    I have a new CD set here 'Helter Skelter vs Raindance: Hardcore 2007' and the data returned by the FreeDB class is not read correctly.

    The DiscID is: 52123717

    Here are two links to images showing the differences returned by my hacked up Flamed and the release Monoton:

    Monoton FreeDB Results

    PhatHack Media Manager FreeDB Results

    At least unlike Flamed it was actually able to identify track info. if the CD is a mixed Audio/Data CD as this CD set is!

  9. #9
    New Member
    Join Date
    Jan 2007
    Posts
    4

    Re: VB6 - Monoton Audio Lib

    It must be the CD entry in FreeDB itself. I've tested both Flamed and Monoton on about 12 mixed data CDs and have never had it crop off the track titles. Both projects use the same FreeDB class from vbaccelerator.com. I will try it on some more of my Mixed data CDs this week.

  10. #10
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Re: VB6 - Monoton Audio Lib

    Nope, it's not the FreeDB entry, that returns fine. I've located the problem and fixed it. If the freeDB track entries return across more than one line, ie:

    TTITLE1=Fedde La Grand / Put Your Hands Up For Detroit (Slipmatt & Billy 'Danie
    TTITLE1=l' Bunter Remix)

    ...the code in AddTitle doesn't cope with this. It's a simple change, entire procedure is pasted below:

    VB Code:
    1. Private Sub AddTitle( _
    2.     ByVal sLine As String _
    3. )
    4.  
    5.     Dim iPos        As Long
    6.     Dim iNextPos    As Long
    7.     Dim sTrack      As String
    8.     Dim lTrack      As Long
    9.  
    10.     iPos = InStr(sLine, "TTITLE")
    11.     iNextPos = InStr(iPos + 6, sLine, "=")
    12.  
    13.     If (iNextPos > iPos) Then
    14.         sTrack = Mid(sLine, iPos + 6, iNextPos - iPos - 6)
    15.  
    16.         If IsNumeric(sTrack) Then
    17.             lTrack = CLng(sTrack) + 1
    18.  
    19.             If (m_iTrackCount < lTrack) Then
    20.                 m_iTrackCount = lTrack
    21.                 ReDim Preserve m_sTitles(1 To m_iTrackCount) As String
    22.                 ReDim Preserve m_sExtended(1 To m_iTrackCount) As String
    23.             End If
    24.  
    25.             'Fixed by VorTechS - multi-line track info only resulted in last line being accounted for
    26.             'm_sTitles(lTrack) = Trim(Mid(sLine, iNextPos + 1))
    27.             m_sTitles(lTrack) = m_sTitles(lTrack) & Trim(Mid(sLine, iNextPos + 1))
    28.         End If
    29.  
    30.     End If
    31. End Sub

    Essentially it's only this line that was wrong:

    VB Code:
    1. m_sTitles(lTrack) = Trim(Mid(sLine, iNextPos + 1))

    And the same problem exists with the extended info:

    VB Code:
    1. Private Sub AddExtendedDetails( _
    2.     ByVal sLine As String _
    3. )
    4.  
    5.     Dim iPos        As Long
    6.     Dim iNextPos    As Long
    7.     Dim sTrack      As String
    8.     Dim lTrack      As Long
    9.  
    10.     iPos = InStr(sLine, "EXTT")
    11.     iNextPos = InStr(iPos + 4, sLine, "=")
    12.  
    13.     If (iNextPos > iPos) Then
    14.         sTrack = Mid(sLine, iPos + 4, iNextPos - iPos - 4)
    15.  
    16.         If IsNumeric(sTrack) Then
    17.             lTrack = CLng(sTrack) + 1
    18.             If (m_iTrackCount < lTrack) Then
    19.                 m_iTrackCount = lTrack
    20.                 ReDim Preserve m_sTitles(1 To m_iTrackCount) As String
    21.                 ReDim Preserve m_sExtended(1 To m_iTrackCount) As String
    22.             End If
    23.            
    24.             'Fixed by VorTechS - multi-line track info only resulted in last line being accounted for
    25.             'm_sExtended(lTrack) = Trim(Mid(sLine, iNextPos + 1))
    26.             m_sExtended(lTrack) = m_sExtended(lTrack) & Trim(Mid(sLine, iNextPos + 1))
    27.         End If
    28.  
    29.     End If
    30. End Sub
    Last edited by VorTechS; Feb 13th, 2007 at 03:06 AM.

  11. #11
    New Member
    Join Date
    Jan 2007
    Posts
    4

    Re: VB6 - Monoton Audio Lib

    I never realized track title entries could contain more than one line. Thanks for pointing that out!

  12. #12
    Lively Member
    Join Date
    Jan 1999
    Location
    Gloucester, UK
    Posts
    78

    Re: VB6 - Monoton Audio Lib

    No problem!

    I've also got a problem at the moment with ID3 tags - but that might be because I've been debugging and can't delete tracks because the file stream wasn't closed. When I can reboot the O/S I'll confirm this.

  13. #13
    New Member
    Join Date
    Apr 2008
    Posts
    1

    Re: VB6 - Monoton Audio Lib

    hey, i tried running monoton_ds_en in VS 2008, it gave an upgrade error sayin dx8vb.dll needed.. i got the file and put it in my system dir but it still didnt work.. anyway so i tried opening it with VB6 . how do i get it to run?? i know this might seem silly but im basically a java programmer... due to the lack of proper sound facilties in JMF ive shifted to VB and C#... also when i run monoton v2 in vb6 it gives up an error saying method show of frmMain failed... any suggestions??

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.