00:15:39 | * | lucasta quit (Remote host closed the connection) |
00:28:09 | * | tokyovigilante quit (Remote host closed the connection) |
00:30:08 | * | tokyovigilante joined #nim |
01:38:18 | * | disso-peach quit (Quit: Leaving) |
02:06:11 | * | rockcavera joined #nim |
02:25:41 | strogon14 | tmpod: open an issue here https://github.com/nim-lang/nimforum/issues or comment on one of the existing ones. |
04:02:52 | * | henriquegogo joined #nim |
05:07:27 | * | pbsds3 quit (Quit: The Lounge - https://thelounge.chat) |
05:09:35 | * | pbsds3 joined #nim |
05:56:09 | * | marcus quit (Remote host closed the connection) |
05:58:05 | * | marcus joined #nim |
06:38:13 | * | tokyovigilante quit (Read error: Connection reset by peer) |
06:38:28 | * | tokyovigilante joined #nim |
07:10:31 | * | ntat joined #nim |
08:08:46 | * | ntat quit (Quit: Leaving) |
08:09:55 | * | coldfeet joined #nim |
08:19:24 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
08:19:48 | * | SchweinDeBurg joined #nim |
11:35:47 | * | coldfeet quit (Remote host closed the connection) |
12:27:37 | * | henriquegogo quit (Read error: Connection reset by peer) |
12:27:55 | * | henriquegogo joined #nim |
12:32:40 | * | coldfeet joined #nim |
12:41:48 | * | henriquegogo quit (Remote host closed the connection) |
12:44:40 | * | henriquegogo joined #nim |
13:28:44 | * | disso-peach joined #nim |
14:03:53 | * | henriquegogo quit (Ping timeout: 255 seconds) |
14:07:27 | * | henriquegogo joined #nim |
14:12:28 | * | henriquegogo quit (Read error: Connection reset by peer) |
14:15:07 | * | henriquegogo joined #nim |
14:17:02 | * | henriquegogo quit (Read error: Connection reset by peer) |
14:17:17 | * | henriquegogo joined #nim |
14:27:02 | FromDiscord | <Phil> TFW you forgot way too much about nim's type-system |
14:33:25 | FromDiscord | <odexine> what about |
14:37:14 | FromDiscord | <Phil> First I forgot that nim doesn't have string unions |
14:37:30 | FromDiscord | <Phil> So no "table1" | "table2", remembered I needed to do enums |
14:37:54 | FromDiscord | <Phil> Now I forgot about switch case syntax which I'm currently looking up |
14:55:38 | * | henriquegogo quit (Ping timeout: 255 seconds) |
14:59:33 | * | henriquegogo joined #nim |
15:08:21 | FromDiscord | <odexine> case xxx↵of enumvalue1: |
15:08:24 | FromDiscord | <odexine> ? |
15:09:46 | * | disso-peach quit (Quit: Leaving) |
15:12:06 | * | henriquegogo quit (Read error: Connection reset by peer) |
15:15:54 | * | henriquegogo joined #nim |
16:21:47 | FromDiscord | <matkuki.> sent a code paste, see https://play.nim-lang.org/#pasty=ZHptihgj |
16:23:01 | FromDiscord | <matkuki.> (edit) "https://play.nim-lang.org/#pasty=DDgZtjfY" => "https://play.nim-lang.org/#pasty=RKUTsJjO" |
16:47:34 | * | xet7 quit (Read error: Connection reset by peer) |
16:50:30 | * | xet7 joined #nim |
16:55:27 | FromDiscord | <heysokam> sent a code paste, see https://play.nim-lang.org/#pasty=gWuuZXxo |
17:04:14 | * | fallback quit (Read error: Connection reset by peer) |
17:07:41 | * | henriquegogo quit (Ping timeout: 252 seconds) |
17:15:37 | * | henriquegogo joined #nim |
17:20:20 | * | fallback joined #nim |
17:36:44 | * | henriquegogo quit (Read error: Connection reset by peer) |
17:42:11 | * | henriquegogo joined #nim |
17:45:48 | * | ntat joined #nim |
17:54:54 | * | xet7 quit (Ping timeout: 246 seconds) |
18:23:22 | * | henriquegogo quit (Ping timeout: 272 seconds) |
18:30:30 | FromDiscord | <demotomohiro> In reply to @matkuki. "Hi anyone, quick question.": The code using `os.joinPath` looks fine. There might be 'undefined behavior` code somewhere else. The code using `getAppDir() & " \\" & filename"` works fine doesn't means there is no 'undefined behavior' code. |
18:37:02 | FromDiscord | <matkuki.> @demotomohiro ↵Thanks for looking at this, here is the entire function with the callback also: |
18:37:19 | FromDiscord | <matkuki.> https://media.discordapp.net/attachments/371759389889003532/1305239884377624686/sndfile_problem.nim?ex=67324ede&is=6730fd5e&hm=c49632773a4d01585acaf92d3bbb824c8090ace2615db98f2444ea0ae20d3a73& |
18:38:24 | FromDiscord | <matkuki.> The proc is called like so: `play_sound_sdl("test.ogg")` |
18:39:11 | * | henriquegogo joined #nim |
18:58:26 | * | henriquegogo quit (Ping timeout: 248 seconds) |
19:03:38 | * | xet7 joined #nim |
19:14:24 | FromDiscord | <demotomohiro> In reply to @matkuki. "": Is `sndfile.open` a part of SDL?↵You don't need to call `sdl2.init` before `sndfile.open`? |
19:26:11 | FromDiscord | <demotomohiro> In reply to @matkuki. "": In `audioCallback(userdata: pointer; stream: ptr uint8; len: cint)`, you don't need to use `len` parameter? |
19:33:54 | * | coldfeet quit (Remote host closed the connection) |
19:38:04 | FromDiscord | <matkuki.> - `sndfile.open` is part of `nim-sndfile`: https://github.com/SpotlightKid/nim-sndfile↵- When calling `play_sound_sdl("test.ogg")` the code doesn't even reach the `audioCallback` stuff, I even commented out everything after the `if sound_file == nil:` block including the entire `audioCallback` proc, and there is no difference, still the `sndfile.open` call returns `nil`. |
19:39:10 | FromDiscord | <matkuki.> The entire `play_sound_sdl` proc is basically a direct copy of this `nim-sndfile` example: https://github.com/SpotlightKid/nim-sndfile/blob/master/examples/playfile_sdl.nim |
19:50:52 | FromDiscord | <demotomohiro> Did you read libsndfile's document and you are sure using the function correctly?↵https://libsndfile.github.io/libsndfile/api.html |
19:53:05 | * | lucasta joined #nim |
19:55:03 | * | henriquegogo joined #nim |
19:57:36 | FromDiscord | <matkuki.> Seems ok to me: https://libsndfile.github.io/libsndfile/api.html#open |
19:58:37 | FromDiscord | <matkuki.> I don't have any non-ascii characters or whitespaces in the path of the built executable. |
20:02:30 | * | henriquegogo quit (Ping timeout: 276 seconds) |
20:06:25 | FromDiscord | <demotomohiro> > Every call to sf_open() should be matched with a call to sf_close() to free up memory allocated during the call to sf_open().↵https://libsndfile.github.io/libsndfile/api.html#open↵I don't know if it is related to your problem, but I cannot `sf_close()` in your code. |
20:09:54 | FromDiscord | <matkuki.> I noticed that also from the library example, but since the `open` result is `nil`, that call would probably do nothing. But I completely agree, it should it be added in a `defer` block. |
20:11:47 | FromDiscord | <matkuki.> I also forgot to mention that this is compiled with MSVC++ compiler, not MinGW. And it's used in a Windows GUI application (it uses `WinMain` as entry point, not `main`). |
20:14:43 | FromDiscord | <demotomohiro> Then, did you compiled `libsndfile` with the same compiler Nim uses?↵And with the same compiler options? |
20:15:39 | * | ntat quit (Quit: Leaving) |
20:18:25 | FromDiscord | <matkuki.> No, I used the precompiled sources from here: https://github.com/libsndfile/libsndfile/releases/tag/1.2.2 |
20:35:04 | * | lucasta quit (Quit: Leaving) |
20:41:47 | * | henriquegogo joined #nim |
21:12:48 | FromDiscord | <spotlightkid> Yes, that should be fixed. The example was written by the original author of nim-sndfile, I just adapted it to current SDL2 and the changes I made to nim-sndfile.↵(@matkuki.) |
21:14:59 | FromDiscord | <spotlightkid> The wrapper should realy have some tests that run in the GH actions CI. One reason why I haven't filed a PR to point the nimble package entry for nim-sndfile to my fork( I have the permission of the original author to do so) is that I would like to have at least a minimal set of tests first. |
21:21:43 | * | lucasta joined #nim |
21:24:44 | FromDiscord | <spotlightkid> What does `strError(nil)` report after this?↵(@matkuki.) |
21:29:42 | FromDiscord | <matkuki.> In reply to @spotlightkid "What does `strError(nil)` report": `System error: The operation completed successfully.` |
21:30:06 | * | lucasta quit (Remote host closed the connection) |
21:46:24 | FromDiscord | <spotlightkid> Is that for the case with `joinPath(getAppDir(), filename)`? I suspect there is some difference in `filepath` after all, that maybe echo doesn't show. Are you sure they don't have different path separators or sth? |
21:50:19 | FromDiscord | <matkuki.> sent a long message, see https://pasty.ee/VpNdFaaa |
21:56:18 | FromDiscord | <spotlightkid> Maybe the strings have different encoding? Did you check the length? |
21:56:21 | FromDiscord | <matkuki.> sent a long message, see https://pasty.ee/NEdLJHQS |
21:57:13 | FromDiscord | <matkuki.> In reply to @spotlightkid "Maybe the strings have": No, how do I check this? |
21:59:43 | FromDiscord | <spotlightkid> `echo $someString.len` |
22:04:12 | FromDiscord | <matkuki.> `joinPath(getAppDir(), filename)` -> 33↵`joinPath(getAppDir(), filename).replace("\\", "/")` -> 33↵`getAppDir() & "\\" & filename` -> 33↵`getAppDir().replace("\\", "/") & "/" & filename` -> 33 |
22:05:54 | FromDiscord | <matkuki.> The path is: `D:\Nim\shutdown_app_iup\alarm.ogg` |
22:09:26 | FromDiscord | <demotomohiro> You can just do `doAssert joinPath(getAppDir(), filename) == (getAppDir() & "\\" & filename)` to see if they are idential. |
22:13:59 | FromDiscord | <matkuki.> sent a code paste, see https://play.nim-lang.org/#pasty=QMmimsmT |
23:23:08 | * | lucasta joined #nim |
23:34:09 | * | henriquegogo quit (Ping timeout: 245 seconds) |
23:34:51 | * | henriquegogo joined #nim |
23:56:30 | * | lucasta quit (Quit: Leaving) |
23:59:45 | * | henriquegogo quit (Read error: Connection reset by peer) |