charlie_says Posted August 13, 2017 Share Posted August 13, 2017 I've been looking at sounds - and I've got a bit stuck. In the PIXI examples, they've got some sound demos (https://pixijs.github.io/pixi-sound/docs/index.html), these look good - but as I'm working in Typescript, and there's currently no typings file to use it with. I think there's a way you can use it without, but I've not had much luck getting that working... (any pointers would be gratefully received) I'm happy to use Howler (or another sound library), in fact I have the typings for Howler already - but it seemed that using this in conjunction with the PIXI.Loader, which would be my preferred route, is also a little convoluted... (and my initial experiments failed without generating any useful errors.) Can anyone give me some guidance? Thanks! Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 13, 2017 Share Posted August 13, 2017 I had the same problem a month ago. However, it was fixed. https://github.com/pixijs/pixi-sound/tree/master/typings And howler is fine too However https://github.com/pixijs/pixi-sound/blob/master/package.json#L7 does contain wrong file for typings. I suggest you to put include the typings as a separate file, its ok to do that in TS. I use both "<reference types" and "<reference paths", sometimes i put typings into special folder and configure tsconfig.json that it looks for them (liks in https://github.com/pixijs/pixi-tilemap , lib folder). Quote Link to comment Share on other sites More sharing options...
charlie_says Posted August 13, 2017 Author Share Posted August 13, 2017 Thanks @ivan.popelyshev - I tried adding the typings file - although it doesn't seem like there's enough in it declare module 'es6-object-assign'; declare module 'promise-polyfill'; But adding that in doesn't get it to work for me... Can you give me any further guidance? Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 13, 2017 Share Posted August 13, 2017 Let us ask the author. @bigtimebuddy What is happening? Quote Link to comment Share on other sites More sharing options...
charlie_says Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks @ivan.popelyshev - can I just check when you used the pixi-sound typings did it only have 2 lines in it? (I'm just trying to work out if I missed something obvious) Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 14, 2017 Share Posted August 14, 2017 I didnt use it. I pinged @bigtimebuddy , and in the week by reading pixi-sound chat (slack. wanna join?) I got impression that he fixed it. I'm still using howler. Found the issue: https://github.com/pixijs/pixi-sound/issues/15 , and he just confirmed that he will work on it this week. again. Btw, that's the only pixi plugin written on TS that doesnt have typings. OK, time to fix that. I'm making fork that doesnt use import/export. Wait two hours. Quote Link to comment Share on other sites More sharing options...
charlie_says Posted August 14, 2017 Author Share Posted August 14, 2017 Many Thanks (I'm happy to join the pixi-sound chat!) Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 14, 2017 Share Posted August 14, 2017 Done, look in your mailbox (@hotmail) for slack invitation. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 14, 2017 Share Posted August 14, 2017 https://github.com/ivanpopelyshev/pixi-sound/tree/namespace/dist Lets try this thing. js file is a bit different too, so you have to download this thing, use typings from "d.ts" please check if it works, i didnt even test it Quote Link to comment Share on other sites More sharing options...
charlie_says Posted August 14, 2017 Author Share Posted August 14, 2017 Thanks for looking into this! Quote Link to comment Share on other sites More sharing options...
tywang2006 Posted August 17, 2017 Share Posted August 17, 2017 I am using howler, which is fine for typescript. Quote Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted August 17, 2017 Share Posted August 17, 2017 @bigtimebuddy took my tool-assist generated d.ts into main repo, he will update it manually. Quote Link to comment Share on other sites More sharing options...
charlie_says Posted August 17, 2017 Author Share Posted August 17, 2017 And, I've tested it out, it works well! ivan.popelyshev 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.