wpf - How do I create a URI string that correctly points to a .wav file in my Resource directory? -


i need play sound byte (mp3 or wav) within wpf application. use mediaplayer. have .wav file with; "build action" = content , "copy output directory" = "copy if newer" , file located in resources directory of app.

however, cant uri string right. (and maybe build action not correct)

i found tolga evcimen , work:

how relative path

var outputdirectory = system.io.path.getdirectoryname(assembly.getexecutingassembly().codebase); var soundbytepath = system.io.path.combine(outputdirectory, "resources\soundbyte.wav");


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -