i trying play sound once button clicked code found everywhere on internet:
private sub but_play_sound_click(sender object, e routedeventargs) handles but_play_sound.click my.computer.audio.play(my.resources.filename1, audioplaymode.background) end sub 'filename1 being audio file
but visual studio comes these 3 errors , stumped.
severity code description project file line suppression state error bc30456 'computer' not member of 'soundbank.my'. soundbank c:\users\nick_\onedrive\documents\visual studio 2017\projects\soundbank\soundbank\mainpage.xaml.vb 10 active
severity code description project file line suppression state error bc30456 'resources' not member of 'soundbank.my'. soundbank c:\users\nick_\onedrive\documents\visual studio 2017\projects\soundbank\soundbank\mainpage.xaml.vb 10 active
severity code description project file line suppression state error bc30451 'audioplaymode' not declared. may inaccessible due protection level. soundbank c:\users\nick_\onedrive\documents\visual studio 2017\projects\soundbank\soundbank\mainpage.xaml.vb 10 active
i should add store audio files in folder inside assets folder.
in vb projects, my
refers special namespace contains objects provide shortcuts common tasks, example my.computer
: https://msdn.microsoft.com/en-us/library/11bxex12.aspx
it not confused me
, my
, mybase
, myclass
described here: https://msdn.microsoft.com/en-us/library/20fy88e0.aspx
the compiler seems saying standalone identifier my
referring soundbank.my
- assume member in class or project (as soundbank
not type-name in clr or base class library).
so use ctrl+,
find out my
being redefined , change my
no-longer refers in project.
Comments
Post a Comment