Option Explicit Private Declare PtrSafe Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal lpstrCommand As String, ByVal lpstrReturnString As String, ByVal uReturnLength As Long, ByVal hwndCallback As Long) As Long
Public WithEvents swApp As SldWorks.SldWorks Private filePaths() As String 'ファイルパスを格納する配列 Private commandIDs() As String '数字を格納する配列
Private Sub Class_Initialize() Set swApp = Application.SldWorks Dim fileNum As Integer 'ファイル数 Dim i As Integer 'ループカウンタ Open "C:\temp\wave\sound_list.csv" For Input As #1 fileNum = 0 While Not EOF(1) ReDim Preserve filePaths(fileNum) ReDim Preserve commandIDs(fileNum) Input #1, filePaths(fileNum), commandIDs(fileNum) fileNum = fileNum + 1 Wend Close #1 MsgBox "VOICEVOX:ずんだもん" & vbCrLf & "(Exit Load : " & fileNum & ")" End Sub
Private Function swApp_CommandOpenPreNotify(ByVal command As Long, ByVal userCommand As Long) As Long Dim i As Integer 'ループカウンタ Dim comandStr As String '再生するコマンドを格納する変数 '数字と比較して対応するファイルを検索する For i = 0 To UBound(commandIDs) If commandIDs(i) = CStr(command) Then comandStr = "play " & filePaths(i) Exit For End If Next i
'再生するファイルが見つかった場合は、wavファイルを再生する If comandStr <> "" Then Call mciSendString(comandStr, "", 0, 0) 'MsgBox comandStr End If End Function
$ pip install -r requirements.txt でCould not find a version that satisfies the requirement opencv-python==4.1.2.30と怒られる。opencv-python==4.1.2.30が無いとのこと。 requirements.txtをopencv-python==4.7.0.68と書き換え
$ pip show torch Name: torch Version: 1.13.1 Summary: Tensors and Dynamic neural networks in Python with strong GPU acceleration Home-page: https://pytorch.org/ Author: PyTorch Team Author-email: packages@pytorch.org License: BSD-3 Location: /home/ootone/.local/lib/python3.10/site-packages Requires: nvidia-cublas-cu11, nvidia-cuda-nvrtc-cu11, nvidia-cuda-runtime-cu11, nvidia-cudnn-cu11, typing-extensions Required-by: torchaudio, torchvision
CUDAのバージョン確認
$ nvidia-smi Thu Jan 19 23:30:12 2023 +-----------------------------------------------------------------------------+ | NVIDIA-SMI 527.92.01 Driver Version: 528.02 CUDA Version: 12.0 | |-------------------------------+----------------------+----------------------+ | GPU Name Persistence-M| Bus-Id Disp.A | Volatile Uncorr. ECC | | Fan Temp Perf Pwr:Usage/Cap| Memory-Usage | GPU-Util Compute M. | | | | MIG M. | |===============================+======================+======================| | 0 Quadro P1000 On | 00000000:01:00.0 On | N/A | | 34% 35C P8 N/A / 47W | 635MiB / 4096MiB | 2% Default | | | | N/A | +-------------------------------+----------------------+----------------------+
+-----------------------------------------------------------------------------+ | Processes: | | GPU GI CI PID Type Process name GPU Memory | | ID ID Usage | |=============================================================================| | No running processes found | +-----------------------------------------------------------------------------+