Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6933299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T11:48:53+00:00 2026-05-27T11:48:53+00:00

I’m recreating an old 16 bit game. I’m creating the chat normally displayed at

  • 0

I’m recreating an old 16 bit game. I’m creating the chat normally displayed at the bottom. Each sentence transitions in character-by-character.

Every time a character is added, I wanted to have it make that little bleep noise. I’ve got a wav file that contains a short ‘blip’ that sounds just right, problem is, when I have it do the blip every time, it usually messes up.

Either it:

  • Skips the character-by-character process and just shows the full word and blips once
  • Lags and does a couple of bips correctly and then does what the thing listed above

Here is where it gets complicated. I’m using Lua and VB.net for this. The engine, I’ve written in VB.net while the actual game mechanics and story line are controlled by Lua.

Here is the basic snippit of Lua:

RegisterEvent("ready", function()
    _G.Chat={}
    _G.Chat["busy"]=false
    _G.Chat.Say=(function(from,msg,done)
        if _G.Chat["busy"] then return end
        _G.Chat["busy"]=true
        local x,y=getRelativePositionOpposite(1024,192)
        --Draw
        local chatPanel=engine:AddSprite("chat.png",0,0,1024,192,x,y,1024,192,5)
        local fromText=engine:AddString(from..":",x+25,y+25,"#FFFFFF",16,0,0)
        local msgText=nil
        local mx=string.len(msg)
        --Chat Cleanup
        setupCleanup=(function()
            local g=true
            RegisterEvent("keyup", function(key)
                if not g then return end
                if key=="Space" then
                    engine:RemoveSprite(chatPanel)
                    engine:RemoveString(fromText)
                    engine:RemoveString(msgText)
                    _G.Chat["busy"]=false
                    done()
                    g=false
                end
            end)
        end)
        doText=(function(i)
            if msgText then
                engine:RemoveString(msgText)
            end
            msgText=engine:AddString(string.sub(msg,1,i),x,y+75,"#FFFFFF",14,1,0)
            engine:PlaySound("chatblip.wav")
            if i>=mx then setupCleanup() return end
            pause(.75,(function() doText(i+1) end))
        end)
        doText(1)
    end)
end)

Here is the pause function, just for reference (in Lua):

_G.pause=(function(t,f)
    if t and f then
        local tt=engine.timer.ElapsedMilliseconds/1000+t 
        local lcc=true
        engine.event_tick:add(function(nt)
            if nt>=tt and lcc then
                f()
                lcc=false
            end
        end)
    end
end)

Here is the snippit that is actually playing the noise in VB.net:

Public Sub PlaySound(ByVal fileFullPath As String)
    My.Computer.Audio.Play(My.Computer.FileSystem.CurrentDirectory & "\bin\sounds\" & fileFullPath, AudioPlayMode.Background)
End Sub

Thanks if you can help! If you need any clarifications, I’m more than willing to help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T11:48:54+00:00Added an answer on May 27, 2026 at 11:48 am

    I used reflector and the internal implementation of Audio.Play uses the SoundPlayer:

    Public Sub Play(ByVal location As String, ByVal playMode As AudioPlayMode)
        Me.ValidateAudioPlayModeEnum(playMode, "playMode")
        Dim sound As New SoundPlayer(Me.ValidateFilename(location))
        Me.Play(sound, playMode)
    End Sub
    

    Reading the sound file for each character is going to be quite intensive on IO.

    To overcome the perf. bottleneck can you try adding a reference to the Microsoft.VisualBasic.dll assembly and use:

    Microsoft.VisualBasic.Interaction.Beep()

    Or just Beep() if your using .Net Framework 2.0 and/OR greater.

    I didn’t drill down very far in reflector but it might also be worth checking if the SoundPlayer uses the PlaySound API and if it doesn’t give that method a go as well:

        <DllImport("coredll.dll")> _
    Public Shared Function PlaySound(szSound As String, hModule As IntPtr, flags As Integer) As Integer
    End Function
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.